How to maken an actor follow another actor

Hey im wondering how I could make an actor 1 follow actor 2. Actor 2 is moveable with a joy-pad.

i can only make actor 1 move to a X,Y point on the screen:(

plz help:D

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited February 2014
    Drag actor 1 into the scene and double click to unlock, do a move to now go to scenes layers and find the actor 2s x and y positions.

    Darren.
  • KmsetroKmsetro Member Posts: 10
    hey darren thankz for the comment, apreciate the fast respond!

    But I have to say that doesnt work.. Actor 2 is the one that i can move by myself. when i setup the positions of actor 2, actor 1 will go to the center of the screen because there is where actor 2 starts.

    Kevin.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    You have to constrain actor 1's x and y positions to actor 2's x and y positions. That way any change in actor 2's location will affect actor 1.

    If you want actor 1 to follow, you'll need an offset value so it isn't right on top of actor 2.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited February 2014
    Umm should work if I think what I think your after lol, away from mac ATM but I'm sure someone will do you a little demo project.

    Ahh you want an actor to follow as in a dog following his master? See what tatiang said above.

    Darren.
  • SocksSocks London, UK.Member Posts: 12,822
    Here's one way you could do it:


    File: https://www.mediafire.com/?s59g39j56z6zl56


    ..
  • KmsetroKmsetro Member Posts: 10
    Thanks for the great responses guys:-D the file Socks sended helped me a little bit, but i doesnt chase the main actor. it only follows the mouse. my actor is moving with a joypad, the camera is focussed on that actor so the screen moves with the actor.
  • SocksSocks London, UK.Member Posts: 12,822
    @Kmsetro
    . . . . it only follows the mouse. . . .

    New version: https://www.mediafire.com/?94c44m1p3d1ljn4
  • KmsetroKmsetro Member Posts: 10
    @socks, thanks for the file but it didn't helped for my project. Maybe you'll understand my problem if i show it too you: http://www.mediafire.com/download/ptzy49q8prtuj70/project+X.zip/project+X.zip ..

    This is my first project, so i dont know how to put my thoughts into the program :( what i want in this game is actor 2 chasing actor 1.. I also want actor 1 can go in all directions with a endless landscape..

    I apreciate your help guys, :-bd
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2014
    @socks, thanks for the file but it didn't helped for my project.
    Thanks for the feedback, good luck with your issue.
  • KmsetroKmsetro Member Posts: 10
    @socks, the issue is finally solved because I misunderstood the posts of you guys, but it finally goes how i want it.. The game is almost ready :D
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Just in case anyone else is curious how to do this.

Sign In or Register to comment.