How to acess attributes from another actor?

GuardianGuardian Member Posts: 54
edited January 2012 in Working with GS (Mac)
Hi guys,

I have two actors in my scene, Actor1 and Actor2

I want to constrain the position of Actor1 to Actor2, but can't find seem to browse to the Actor2's attributes when using the Expression Editor.

What do I have to do to be able to access other actors attributes?

Kind regards,
Guardian

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    edited January 2012
    The best way is to set up 2 real attributes and constrain them to the main actors X and Y positions. Then in the second actor, constrain it's X and Y positions to the attributes with an offset to the desired positions.

    But if you want to access one actors attributes from another, you have to have it on the stage, and unlock it, and go into the Expression Editor through a behavior and go >Current Scene>Layers>Background and you can access all actors and their attributes that are on the background layer.

    If you have more than one layer, you select what layer you want instead of "Background" in the Expression Editor.
  • GuardianGuardian Member Posts: 54
    Cheers Slick, '>Current Scene>Layers>Background>...' was just the thing I was looking for to get to the other actors attributes.

    What happens if I make changes to the actor instance on the stage and then edit the actor prototype? Will it do funny things to the instance? i.e. not recieving the new behaviors and attributes..
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2012
    Hi @Guardian, if you make any changes in a Prototype actor in the inspector, all (locked) prototype copies on-screen will change accordingly; but the changes don't affect any unlocked instances of the prototype in any way, as they have become independent of the prototype. (And the reverse it true also: any changes made to an instance do not affect the original prototype).


    ----------------------------------------------
    http://davidgriffinapps.co.uk/

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

  • GuardianGuardian Member Posts: 54
    Thanks @gyroscope, I am a little concerned that now I will have to setup most of my rules and behaviours in the scene because they are dependant on other actors, but thank you again for answering. :)

    -Guardian
Sign In or Register to comment.