Actor following Actor

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

Comments

  • gamewizard99gamewizard99 Member, PRO Posts: 67
    You could do the following steps:
    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.
  • LooseMooseLooseMoose Member Posts: 224
    edited October 2012
    Is actor 1 a full screen background? If it is you could just create a new layer and put your actor 1 in the new layer and uncheck the box that says scrollable
Sign In or Register to comment.