Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Ktotoetoia |
I am creating a 2D platformer in which there is an enemy that has to change its side when it touches the platform, but using scale it changes its side every frame, how can I pin number(-1)?
Please add some code.
clemens.tolboom | 2021-04-23 15:36
If globals.player.position.x < position.x
Vel.x = speed
Scale.x =-1
If globals.player.position.x > position.x
Vel.x = -speed
Scale.x = 1
Ktotoetoia | 2021-04-23 15:45