How to create a flying enemy and make it follow player in 2D game?

Hello every one

I would like to create a flying enemy and make it follow the player in a 2D game
Please refer to the below link to find my demo project
https://playcanvas.com/project/1009395/overview/helloworld

Firstly I have no idea to make the object float in the sky.
I try to set the enemy’s Type to “Static”
or set Type to “Dynamic” and add this code

this.entity.rigidbody.applyForce(0, 9.8, 0);

But it can’t move the enemy.

I find the tutorial on forum

and this code can help me make object move to object easily

this.entity.lookAt(player.getPosition());
this.entity.translateLocal(0,0,-0.1);

but when the enemy move to the player.
the enemy image is auto rotation
image

Is it possible to fix the image angle and make it not auto-rotate???

Thank you very much

Anyone help? Thank you very much

Hi @supsersuperman! I think for lookAt, you need to use for one axis the position of the entity itself instead of the position of the target. In most cases this should be the Y axis.