enemy follow and face player
emoji
Member, BASIC Posts: 66
Hi all, I this question which I'm not sure how to handle so please help. As of now, I have my enemy follow my player and it works great but if my player were to move forward, my enemy also follows but the problem is it does not turn its face toward the player. How do I have my enemy face follow the enemy? I appreciate any help!
Comments
You need to constrain the enemies rotation:
You will need to constrain the Players X and Y positions to game attributes if you haven't already.
In your enemy Actor:
You need a constrain behaviour to constrain the rotation attribute.
You want to use the vector to angle function.
Function = vectortoangle(player.X - enemy.X, player.Y - enemy.Y)
Best,
GSLearn.com | Templates | Free Demos | Udemy Course