**Help Constraining Actors**

Mikv616Mikv616 Member Posts: 28
edited July 2012 in Working with GS (Mac)
Hi I wanted to know how exactly do I constrain the position of a actor by using the position of another constantly moving actor thanks!

Best Answer

  • gyroscopegyroscope I am here.Posts: 6,598
    edited July 2012 Accepted Answer

    Hi @Mikv616

    I'll answer with an example: constantly moving actor's starting x,y is 200,150, and the actor to follow is 300,100, let's say.

    use 2 Constrain Behaviours as follows:

    Constrain Attribute FollowActor.Position.x to MovingActor.Position.x + 100
    Constrain Attribute FollowActor.Position.y to MovingActor.Position.x -50

    If you wanted it to follow exactly, then don't put any offsets.

    Hope that helps.

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

Answers

  • Mikv616Mikv616 Member Posts: 28
    edited July 2012
    Thanks @Gyroscope so is the +100 and -50 the offset here? And are the FollowActor.Postion.X attributes that I am supposed to make? If so what kind of attributes?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited July 2012

    Yes, the +100 and -50 as examples are the offsets; the position.X and position.Y for both actors – leading and following – are already there in their attributes, you don't have to make them.

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

  • Mikv616Mikv616 Member Posts: 28
    edited July 2012
    @Gyroscope Ok Im still a little confused on how I constrain it. So if I type in the constrain attribute box of the actor that is following, self position.x what do I type in the box next to that one?
  • Pennez-GamesPennez-Games Member Posts: 107
    @Gyroscope Ok Im still a little confused on how I constrain it. So if I type in the constrain attribute box of the actor that is following, self position.x what do I type in the box next to that one?
    you can find a tutorial about this from tshirtbooth's youtube channel, i learnt how to constrain actors from him, he is very easy to follow, and i have the pc version of gamesalad which is much different to the mac, and i followed, check out his youtube channel. tshirtbooth
  • Mikv616Mikv616 Member Posts: 28
    Ok thanks ill give it a look
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Hi Mik,

    I responded to your PM about this too, hope you get it worked out.

    Jamie
Sign In or Register to comment.