Inter-Actor Messaging

hillelchillelc Member Posts: 56
edited November -1 in Working with GS (Mac)
I'm assuming the only way for one actor to set an attribute for another is to communicate through global attributes. But I just want to make sure I haven't missed some way for me to have one actor tell another what to do. (i.e. touch Actor A, and Actor B animates).

Thanks in advance.

--hillel

Comments

  • RHRH Member Posts: 1,079
    You can change self. attributes. If you edit the instance in a scene you can access the attributes of another instance in the same scene.

    Other than that, yep, as tshirt says, you have to use global attributes.
  • hillelchillelc Member Posts: 56
    Super helpful. thank you.

    One more question... do actors continually listen for changes in global attributes?

    For example...

    * I set GA to true
    * i set actor to spin when GA is true and then reset GA to false
    * a minute later I set GA to true again and expect the actor to spin again, but it doesn't

    any way to set something to keep listening?
  • hillelchillelc Member Posts: 56
    I'm not sure I explained myself well. Let me try again:

    1) when actor.button is pressed i set GA to true
    2) actor.that.moves has a rule that when GA is true it moves 10 pixels to the right.
    3) i have a timer in actor.button that resets the GA to false after a second or two (when I know the move is complete)
    4) I have another button that sets GA.LEFT to true
    5) actor.that.moves has another rule that when GA.LEFT is true it moves 10 pixels to the left.

    BUT... actor.that.moves appears to have stopped listening after the first move.

    Does that clarify?
  • Rob2Rob2 Member Posts: 2,402
    look into Current Scene and Layers in the expression editor for direct actor to actor control
  • hillelchillelc Member Posts: 56
    Thanks tshirtbooth. I have confirmed in fact (using display text) that the GAs are getting reset appropriately. And yet:

    * actor.that.moves only responds to the first GA value change. Not to any others.

    Actor.that.moves behaviors look like this:

    * control camera
    * if GA.right = true then move 1024 to the right relative to the actor
    * if GA.left = true then move 1024 to the left relative to the actor

    I've tried nesting things in various combinations. No luck.
Sign In or Register to comment.