How to make all physics object slow moving (slowdown)?
this.physics.world.timeScale = 0.5;
I already try code above, but the movement get faster, if i set more than 1, nothing affected.
How to make all physics object slow moving (slowdown)?
this.physics.world.timeScale = 0.5;
I already try code above, but the movement get faster, if i set more than 1, nothing affected.
without code it’s hard to tell, but maybe this thread will help?
I use this thread as my reference, but it’s not working as i expected.
My code to add physics object
function add_enemy(life, type){
stage.enemys++;
enemy_id++;
let scale = Math.floor(Math.random()*3)+1;
let o = self.physics.add.sprite(360,-200,'enemy'+type);
enemys.add(o);
o.setCircle(80, 70,70);
o.setScale(1/scale);
o.scale = 1/scale;
o.enemy = true;
o.setCollideWorldBounds(true);
o.setBounce(1,1);
o.life = life;
o.def_life = life;
o.setTint(get_color(o.life));
o.id = enemy_id;
o.rotate = 0;
o.rotate_min = (Math.random()*4)-3;
let angle = BetweenPoints(enemys, {x: 100, y: 700});
velocityFromRotation(angle, 100, velocity);
o.setVelocity(Phaser.Math.Between(-100, 150), Phaser.Math.Between(70, 250));
o.txt = self.add.text(o.x, o.y, get_decimal(o.life), {fontFamily: 'impact', fontSize: 65, align: 'center', color: '#fff'});
o.txt.setOrigin(0.5);
o.txt.setScale(1/scale);
_update(o);
}
Another configuration
this.physics.world.checkCollision.up = false;
this.physics.world.checkCollision.down = false;
this.physics.world.on('worldbounds', onWorldBounds);
this.physics.add.overlap(enemys, bullets, collision);
this.physics.add.overlap(powerups, ship, get_powerup);
Thanks
I am facing this issue as well. I am trying to create a slowmo effect throughout my game (written with phaser 3). I tried it with scene.physics.world.timeScale = 0.1. The game went faster. I dont know if I am using the feature wrong or if its a bug. Do tell me if you figured out how to achieve slowmo.
Thanks.
Update:
Making the values greater than 1 is making time slower. I tried it as scene.physics.world.timeScale = 2 and the time slowed down. Hope it helps.