playMaker

Author Topic: Using Mecanim to Open Doors (Non-Legacy Animation)  (Read 5260 times)

Redhawk

  • Junior Playmaker
  • **
  • Posts: 57
Using Mecanim to Open Doors (Non-Legacy Animation)
« on: January 21, 2014, 11:15:57 PM »
UPDATE - I made some videos on how to do this.
http://www.youtube.com/playlist?list=PLm7dDCs_gFwOEFTkwHXGjUgfHSOHdiO1H

First, grab the Mecanim Add-On from Wiki
https://hutonggames.fogbugz.com/default.asp?W1031

Create your Animations the new way in Unity.  I set my pivots and created 3 animations - DoorClosed (nothing in animation), DoorOpen (rotation curve Y 105), DoorClose (rotation curve Y 0).

Set up your Animator (see picture).

Playmaker Setup - See Image
- Wait For Click to... - Mouse Pick Event.  Both are setup like the picture, except Close points to CloseDoor
- DoorOpen (See Picture)
   - Set Animator Bool - Parameter=OpenDoor, Value is Checked
   - Wait - Time = 5, FinishEvent=Finished.  Do this so you don't have an infinite loop
- DoorClose (See Picture)
   - Set Animator Bool - Parameter=OpenDoor, Value is Not Checked
   - Wait - Time = 5, FinishEvent=Finished.  Do this so you don't have an infinite loop
« Last Edit: February 08, 2014, 05:51:39 PM by Redhawk »

Jotunheim

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Using Mecanim to Open Doors (Non-Legacy Animation)
« Reply #1 on: March 04, 2014, 06:12:09 AM »
Great Tutorial Redhawk! Very useful to understand how to trigger animation in mecanim from Playmaker.

This could be used for any kind of animation, I used to animate a character depending on a proximity trigger and it works.

 You're awesome!

« Last Edit: March 06, 2014, 07:51:04 PM by Jotunheim »

Redhawk

  • Junior Playmaker
  • **
  • Posts: 57
Re: Using Mecanim to Open Doors (Non-Legacy Animation)
« Reply #2 on: March 04, 2014, 04:57:56 PM »
Thanks.  At some point I plan on doing some other tutorials too even though Lane's tutorials are much better.

Yes, the mecanim add on is very handy.  I haven't built out a character yet, but I can definitely see how Playmaker is a great "go between" between nearly anything.

mpaul0055

  • Playmaker Newbie
  • *
  • Posts: 31
Re: Using Mecanim to Open Doors (Non-Legacy Animation)
« Reply #3 on: March 06, 2014, 05:52:00 AM »
Cant thank you enough for this Chris! Will definitely be implementing this method into my new project.