constrain actor to another actor

bertkromabertkroma Member, PRO Posts: 22
edited February 2012 in Miscellaneous
I've recently come over to GS from Construct2, and was wondering if there is a way to constrain one actor to a different actor?

Comments

  • HappyKat78HappyKat78 Member, BASIC Posts: 173
    Yes, there's a specific constrain behavior. I suggest starting out looking at the cookbook, watching some video tutorials and searching the forums. you'll easily find answers to things like this. :-)
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited February 2012
    Hi @bertkroma, welcome to GS. :-)

    One of the behaviours in GSC is the contain behaviour, that'll do what you want.

    Edit: typing same time as @HappyKat78

    ----------------------------------------------------------------------------
    iPad app: End of the Earth –•– http://davidgriffinapps.co.uk/
    ----------------------------------------------------------------------------

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    These 2 videos should help you out.



  • bertkromabertkroma Member, PRO Posts: 22
    Thanks Gyroscope, but I tried that and it doesn't follow the controller. I must be doing something wrong. Here is what I'm doing:
    paddle1=actor to be constrained
    controller1=actor to be constrained to
    on the paddle1 I added Constrain Attribute and in the behavior I set the expression to self.position.x to controller1.position.x

    also the controller1 didn't show up in the paddle1 expression editor so I typed it in manually, does it need to be added to some sort of global area?
  • bertkromabertkroma Member, PRO Posts: 22
    Thank you Slickzero. The videos cleared it up for me. I remember watching these in october before I started with Construct2. It's been awhile. I was missing the add attribute step.
Sign In or Register to comment.