playMaker

Author Topic: HELP! Control animation by clicking different buttons.  (Read 1825 times)

Messjuh88

  • Playmaker Newbie
  • *
  • Posts: 5
HELP! Control animation by clicking different buttons.
« on: October 05, 2012, 09:56:24 AM »
Hi Playmakers,

i need your help!

I have a scene with an animated object (object A) and three buttons to control it.

Object A has a sequence of three numbered (1..2..3..) loop idle animations.
Object A should play only one of these animations (but in chronological order) once the user hits a random button of his choice.

After the first random button is hit, the first animation (1) of the sequence will be played and let the button disappear (including its functions).

Now the user can choose and activate another one of the left 2 random buttons which would let object A play now the second animation (2) of the sequence, and then disappear aswell.

Same with the last button (activate animation 3 and then disappear).

Does somebody know how to let unsorted or randomly selected/pressed buttons activate a sequence of animations sorted by numbers one after the other?

Thanks a lot for answering!

Messjuh88
« Last Edit: October 05, 2012, 03:14:19 PM by Messjuh88 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: HELP! Control animation by clicking different buttons.
« Reply #1 on: October 09, 2012, 02:23:16 AM »
Hi,

 Sounds very twisted :) I think you need to cut down the problem into smaller more obvious cases.

-- Being able to trigger a given animation on an object

using the action "play animation" you simply select one of the defined animation on the gameObject and done

-- Being able to randomise the animation selection

Using the "Select random String" action, you define there all the different possible animation, store it in a strin variable and inject it in the "Play animation" mentionned above

-- how to hide object

Hiding object can be done by destroying them using "Destroy Object" or "destroy Self" for example.
You can also hide object by moving it outside the camera view or switching it's layer using "set Layer" prior having set the camera to ignore that particular layer when rendering.


Does all the of the things above are fine with you? maybe you have a problem elsewhere as to how to combine them actions together?

bye,

 Jean