Actor action related to another action

ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
edited November -1 in Working with GS (Mac)
Please can someone help me with this problem...

I need to know how to change an actors behaviour when another actor is interacted with...here is the scenario.

I have a button which acts like a switch and plays a sound when it is pressed...easy bit

The problem i have is that I need another actor in the same scene to rotate when the button is pressed...sort of link the two together and it only needs to happen when that particular button is pressed.

I've been looking around on the forums and Google and can't seem to see a 'link' thing between two actors?

Please can someone help me?

Actor 1 is called 'Button' and actor 2 is called 'Blade'.

Thanks

It takes a Zombie to know a Zombie!!!

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi, make a boolean "switch" that'll trigger the rotation movement when the button is pressed. So:

    boolean att. called RotateGo set to default false

    In your button actor, Rule: when touch is pressed
    change attribute RotateGo to true

    In your Blade actor, Rule: when RotateGo is true
    Rotate behaviour.

    You can "switch off" the rotation by changing the attribute RotateGo to false again.

    :-)

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

  • alkexalkex Member Posts: 38
    Go the the Attributes tab in the inspector

    Create a Boolean called ButtonPressed (hit the + button, middle left of your screen).

    if button is touched:
    change attribute "game.ButtonPressed" to "true"

    Now create a rule inside of "Blade":
    if "game.ButtonPressed" is "true" .. do stuff!

    :)
  • alkexalkex Member Posts: 38
    Gyroscope, you beat me to it AND you included a nose in the smiley...
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    alkex said:
    Gyroscope, you beat me to it AND you included a nose in the smiley...

    :-)

    Whoops, there I go again!

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

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Hi guys...wow excellent stuff but its not quite working..

    I've set up the RotateGo as a Boolean - Done 'i've left the tick as unticked as if I tick it the blade starts to spin on its own as soon as i preview it.

    I've set up a 'Change Attribute' in the Button rule to set as 'True' on the button

    Then set up the 'Attribute' GameRotateGo is True = rotate 90 degrees speed 90 on the blade

    I don't know how to set the default value on the Boolean to 'False'...is that the tick thing?

    Sorry, newbie here..

    It takes a Zombie to know a Zombie!!!

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Hi Alkex and Gyroscope

    Managed to work it out...apparently you cannot use 'True' you have to type in the expression 'true' (All in lower case)

    Works a treat now...

    Thank you ever so much guys.... :)

    It takes a Zombie to know a Zombie!!!

Sign In or Register to comment.