P
ProjectGamesInc
Guest
Hi all,
I'm trying to rotate an enemy that is following a path.
using image_angle = direction works but it gives me the "lag" (it dosent change smoothly the angle) effect beacouse the enemy is moving slowly and i have big difference beetween the "past" direction and the "actual" one from step to step.
Then i wrote something like this
image_angle = lerp(image_angle,direction,0.1)
It also work and the image angle change smoothly but, when my enemy it is facing right (or it is near that angle) seems like the sprite do a fast loop the loop and then start again rotate smoothly.
I hope i described the problem well.
Any help about a solution?
Thanks!
I'm trying to rotate an enemy that is following a path.
using image_angle = direction works but it gives me the "lag" (it dosent change smoothly the angle) effect beacouse the enemy is moving slowly and i have big difference beetween the "past" direction and the "actual" one from step to step.
Then i wrote something like this
image_angle = lerp(image_angle,direction,0.1)
It also work and the image angle change smoothly but, when my enemy it is facing right (or it is near that angle) seems like the sprite do a fast loop the loop and then start again rotate smoothly.
I hope i described the problem well.
Any help about a solution?
Thanks!