Getting an actor to read another actor's self attribute...possible?

okkleokkle Member Posts: 32
edited November -1 in Working with GS (Mac)
Good morning fine fellows of the Game Salad forums!

I have two actors, one which will move and collide with the other which is static. The static one has an integer self attribute which it randomly sets at the start as a number between 1 and 5, and loads a different graphic accordingly (they are different kinds of traps).

I'd like for the moving actor to run a different animation when it collides with the static actor, depending on the number that static actor has given itself in the self integer attribute. It has to be a self attribute as there will be multiple static actors so a game attribute doesn't work in this case (it'd make all the static actors the same type of trap)

Is there a way to do this?

Comments

  • TumbleSoftTumbleSoft Member Posts: 63
    It is possible.

    You have to unlock the moving actor. Then when you go into the actor and then into the attribute selector there is a new option, "Current Scene". Click on that and go into "layers" then choose the layer the static actor is in. You will see that actor. From there you can access all of its personal attributes.

    This way works however it would probably be easier just to make that a game attribute.

    Hope this helps.
  • okkleokkle Member Posts: 32
    Ah that's brilliant thanks I will try that. I didn't know that had been added :)
  • TumbleSoftTumbleSoft Member Posts: 63
    Yes its annoying it is not easier.

    If I were you I would probably just make Game Attributes. It stops the confusion of having lots of different instances of actors that you can't edit all from one place.
  • okkleokkle Member Posts: 32
    To be honest I've already got 70 odd game attributes for other things so it's getting a little cluttered there, having different instances may be easier! I'll try both methods and see which works best, I've got to hand this over to my puzzle/level designer so I want it to be as smooth as possible for them.

    You've been a tremendous help, thanks so much!
  • TumbleSoftTumbleSoft Member Posts: 63
    No Problem. Hope it helped.
Sign In or Register to comment.