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

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


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

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.