playMaker

Author Topic: [SOLVED] problems triggering a door (animation)  (Read 5569 times)

Martin-Vaupell

  • Junior Playmaker
  • **
  • Posts: 70
  • Creating CarbonDiOxide
    • Evisystems
[SOLVED] problems triggering a door (animation)
« on: January 05, 2014, 09:23:59 PM »
I've been following the tutorials on site, but i think some of them is outdated.
Gamedesign with playmaker the tutorial with the chest opening.

well i tryed to do the same thing, however Unity auto adds the "animator" script.
and playMaker requires the "animation" script.

See the screenshot




Now i can't get the animation to work until i add the runtime controller in the
animator, but then i need to go and set the states i the animator :(



I would prefer is i could just "play animation" as usual without using unitys animator.

I have allready tried
- removing the animator script which does nothing.
- adding the runtime controller which just makes the door open at scene start.
- tryed removing the animations script but then playmaker complains.


Any ideas how to make this work ?
« Last Edit: January 06, 2014, 09:43:04 AM by VaupellAgainNoMailReceive »

fromfame

  • Junior Playmaker
  • **
  • Posts: 78
  • Sloppy PM Veteran
Re: problems triggering a door (animation)
« Reply #1 on: January 05, 2014, 10:48:03 PM »
I can give you one of my personal ways of animating a door after play enters trigger and ways to avoid any unexpected actions.

First untick the animation component,
Create this:

A box with a trigger collider that has "is trigger" ticked on.
Add these states and actions in the box.

State 1 actions:
- trigger event on stay.

State 2 actions:
- trigger event on exit.
- get key down. (Choose E or what ever)
- GUI text "[E] to open" (optional)

State 3 actions:
- enable behavior (drag the GO with the animation to this action and specify the animation component, then choose enable)
- wait. (Set time till animation is done)

State 4:
- enable behavior (disable animation instead of enabling)
Then link state 4 to state 1.


This is all off the top of my head, (I'm just having tea at home, morning!) there are many other ways to do this.

Martin-Vaupell

  • Junior Playmaker
  • **
  • Posts: 70
  • Creating CarbonDiOxide
    • Evisystems
Re: problems triggering a door (animation)
« Reply #2 on: January 06, 2014, 05:58:14 AM »

enable/disable is not a viable solution, needs to close aswell,
so will be needing to run 2 animations open / close.

The problem is, playMaker won't run the animation.
However when i use the Unity Animator it works fine.

It's as if the "play animation" does not trigger the animation component.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: problems triggering a door (animation)
« Reply #3 on: January 06, 2014, 08:33:20 AM »
Hi,

 It's likely because the animation is of the wrong type, it will only work for legacy animations, not mecanim based animation. Unity "animation" word became very confusing unfortunatly.

bye,

 Jean

Martin-Vaupell

  • Junior Playmaker
  • **
  • Posts: 70
  • Creating CarbonDiOxide
    • Evisystems
Re: problems triggering a door (animation)
« Reply #4 on: January 06, 2014, 09:42:52 AM »
Hi,

 It's likely because the animation is of the wrong type, it will only work for legacy animations, not mecanim based animation. Unity "animation" word became very confusing unfortunatly.

bye,

 Jean

haha yes that was the problem ;)  Thank you!!!

I got it working, by importing it as Legacy instead, also changed the setup
so i added the animation using "playMaker" instead of the scripts.

Awesome..