EditMake an actor chase another actor
Basic Idea: Define a 'toward' motion that is relative to the other actor. Make sure your actor is lighter than the other actor, otherwise you will start pushing the other actor!
Sample Game:
http://www.popfly.com/users/team/HowDoI-ChaseAnotherActorDetails:
- Define a motion behavior that starts on load (or any other desired event). In the motion dialog, select 'Relative to' as 'Actor' and then select the actor you want to chase. Choose "any instance" of the actor if you want to chase the actor regardless of scene (if there is more than one instance in a scene you will chase the closest), otherwise choose "The specific actor instance from this scene:" and the scene/actor instance combo you wish to chase. Once you select the actor, the motion directions will let you chose 'Toward' or 'Away'. You can change the 'Max Speed' to control how fast you want to chase.
Actor (chaser)->Behaviors->Motion
 Pea chasing Jelly Fish (Click the image to view full size) |
- Be sure that the actor you are chasing is heavier than the one chasing it.
Actor (being chased) -> Property
 Making Jelly Fish heavier than the Pea |