This site requires JavaScript, please enable it in your browser!
Greenfoot back
FJacobs
FJacobs wrote ...

2023/3/6

How do I make an Actor follow another Actor?

FJacobs FJacobs

2023/3/6

#
Thanks for any help!
danpost danpost

2023/3/7

#
FJacobs wrote...
How do I make an Actor follow another Actor?
First, get a reference to the actor it wants to follow; then, turn toward it and move toward it. Depending on your scenario, you may need to reset the rotation of the follower back to zero to complete the steps involved. If the follower moves at a slow rate (certainly, if less than 5 pixels per move), you might consider using a smooth mover support class to eliminate any inaccuracies in moving direction.
You need to login to post a reply.