Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Jotunheim on February 26, 2014, 06:40:28 AM
-
Hi Mates, I am new user of playmaker so excuse my "newbiness"
As a tutorial, I am trying to call an animation in mecanim when the user go inside a proximity trigger created with playmaker.
The point is I don't understand how to call the mecanim animation with playmaker with the proximity trigger, could you point out the solution? Thanks
-
You need to send an Event or change some variable for Mecanim to respond to.
You'll need the Animator Actions (https://hutonggames.fogbugz.com/default.asp?W1031) first of all, then you can change the variables on the Animator component easily. So you essentially want to detect that you've entered the trigger and then send an Event (or bool, or whatever) to Mecanim. On the Mecanim side you just setup the transition between states to move to the animation you want when that Event (or bool, or whatever) is triggered.
-
Thanks Lane! With your hints I get it work. It needed also additionnal research.
In case other users would like to do so from scratch, here is what I did:
The first place to go is the video tutorial to understand mecanim:
http://www.youtube.com/watch?v=Xx21y9eJq1U (http://www.youtube.com/watch?v=Xx21y9eJq1U)
Then you have the very neat tutorial of Christopher Orth about creating trigger with playmaker:
http://www.youtube.com/watch?v=BYwkd80T5Zk&list=PLC759306A1E692A10 (http://www.youtube.com/watch?v=BYwkd80T5Zk&list=PLC759306A1E692A10)
And at last the great tutorial of Redhawk about calling animation in mecanim with playmaker:
http://hutonggames.com/playmakerforum/index.php?topic=6104.0 (http://hutonggames.com/playmakerforum/index.php?topic=6104.0)
So in a nutshell, I used mecanim for the animation logic, introduced a bolean parameters in the transition and in playmaker for the proximity trigger state I used the action: Set Animator Bool which is related to this parameter (check value means TRUE, uncheck means FALSE).
Besides in case you are wondering Set animator Trigger seems not a way to go as it trigger several animation at the same time...
Cheers!