Game Development Community

Moving a sprite towards another sprite

by John Walsh · in Torque 2D Beginner · 02/13/2014 (2:05 pm) · 3 replies

Hey I'm trying to get my enemy sprite to follow where my player sprite goes, what way should I be doing this? Basically it will look like the enemy is following the player to kill him.

#1
02/13/2014 (2:44 pm)
Have a look at the scripts in the DeathBallToy. It's a good example of what you are looking for.
#2
02/14/2014 (4:47 am)
Specifically, the FaceObjectBehavior and MoveTowardBehavior scripts. Those are isolated enough to reuse in other projects.
#3
02/15/2014 (5:38 am)
Got it to work, thanks.