Actor following Actor
Yax_Inc
Member Posts: 14
Hello GS Nation.
I want that my actor1 follows another actor2. Actor 1 is the "Background" and i want to have the same actor1(background) all the time with the actor 2 moving...
Anyone an idea?
-Yax
I want that my actor1 follows another actor2. Actor 1 is the "Background" and i want to have the same actor1(background) all the time with the actor 2 moving...
Anyone an idea?
-Yax
Comments
1) Create two variables called, actor2x and actor2y ( both integers).
2) Go into actor2 and add two constrain attributes;
1. constrain actor2x to self.position.x
2. constrain actor2y to self.position.y
3) Go into actor1 and add move to actor2x ( position x ) and actor2y ( position y ) at a speed of 500 (can be any speed you want).
4) Press preview and hopefully it works
p.s. I'm not entirely sure what you want to use this for but otherwise you could make the background tile-able ( in the properties/attributes section of actor1) or just increase the size of the background.
Hope this helps, just ask me if you need any extra help.