Hello, and have a nice day.
I would have a difficulty with a small game in top down.
I would like the player to be able to be followed by enemies that will constantly walk in his direction, but I can’t manage to do it and I can’t really find directions, so I would like to ask for your help.
I found a phaser tutorial on github and another one on the internet that talks about a method
update(targetOfCrab) {
//#region movement
const speed = 300;
this.body.setVelocity(0);
this.rotation = Phaser.Math.Angle.Between(this.x, this.y, targetOfCrab.x, targetOfCrab.y)
this.physics.velocityFromRotation(this.rotation, speed, this.body.velocity);
} // End of update
but I get an error message and I don’t understand where it could come from…
Do you know why I’m having this one ? Thanks a lot for the time and have a great day !