playMaker

Author Topic: [SOLVED] Mecanim : Proximity trigger calling an animation  (Read 2329 times)

Jotunheim

  • Playmaker Newbie
  • *
  • Posts: 8
[SOLVED] Mecanim : Proximity trigger calling an animation
« 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
« Last Edit: March 06, 2014, 07:45:50 PM by Jotunheim »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Mecanim : Proximity trigger calling an animation
« Reply #1 on: February 26, 2014, 09:49:06 AM »
You need to send an Event or change some variable for Mecanim to respond to.

You'll need the Animator Actions 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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Jotunheim

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Mecanim : Proximity trigger calling an animation
« Reply #2 on: March 06, 2014, 07:43:20 PM »
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

Then you have the very neat tutorial of Christopher Orth about creating trigger with playmaker:
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

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!
« Last Edit: March 06, 2014, 07:48:13 PM by Jotunheim »