playMaker

Author Topic: "Set Animation Time" equivalent in Mecanim?  (Read 6317 times)

swogdog

  • Playmaker Newbie
  • *
  • Posts: 4
"Set Animation Time" equivalent in Mecanim?
« on: June 17, 2015, 12:37:20 AM »
Hi!  I did some searching already and was unable to find an answer.  I need to switch to Mecanim for my animations because I need to control some things that Legacy animations no longer work with (super-sadness).  I have been using "Set Animation Time" with Legacy animations and was wondering what the equivalent is for Mecanim.  I have the Mecanim Playermaker package installed.  What I have set up currently does not work.  I am doing "Animator Start Playback" then "Set Animator Play Back Time" every frame and the animation just sits there on it's first frame and never changes.

Any help would be appreciated!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: "Set Animation Time" equivalent in Mecanim?
« Reply #1 on: June 17, 2015, 06:16:06 AM »
i think playback time should not be set every frame,
have you set up your animations inside the animator?

you can check this tutorial out, part 4 is about converting to mecanim

swogdog

  • Playmaker Newbie
  • *
  • Posts: 4
Re: "Set Animation Time" equivalent in Mecanim?
« Reply #2 on: June 17, 2015, 04:26:32 PM »
Thanks for the link!

That's not quite what I'm trying to do, though.  Basically I have a single animation, and I set the time on that animation based on the mouse position.  So every frame I get the mouse position, do some math, and set the animation point.  The animations never really "play".  The animation is set up right in Mecanim I think because it plays perfectly fine when I don't try to tell it to do anything via playermaker, so I know it's working.

thatnzguy

  • Playmaker Newbie
  • *
  • Posts: 43
Re: "Set Animation Time" equivalent in Mecanim?
« Reply #3 on: June 17, 2015, 05:25:31 PM »
I've found the mecanim integration lacking, there's a few key things it can't easily do that a simple animation interface could.

I haven't used the Animator Playback stuff, it sounds like it's deal with a buffer somewhere. I have the impression you have to 'record' to the buffer and these Playback actions deal with that, rather than the mecanim states themselves.


swogdog

  • Playmaker Newbie
  • *
  • Posts: 4
Re: "Set Animation Time" equivalent in Mecanim?
« Reply #4 on: June 17, 2015, 11:22:55 PM »
Yeah, that's sorta what I'm figuring out...

I just want to set an anim time, that's it.  I'm not a programmer, but it seems like this should be a part of Playmaker by now...  that is, unless it can't be done in Unity at all?  Mecanim has been the main anim system for quite some time now. :-\

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: "Set Animation Time" equivalent in Mecanim?
« Reply #5 on: June 18, 2015, 02:33:38 AM »
Hi,

 Can you get the latest patch from Unity 5, apparently they fixed something around the timing set of mecanim states.

 Bye,

 Jean

swogdog

  • Playmaker Newbie
  • *
  • Posts: 4
Re: "Set Animation Time" equivalent in Mecanim?
« Reply #6 on: June 19, 2015, 12:07:15 AM »
I just updated and nothing changed for me.  I don't think I'm using the right actions for what I want to do, and I'm not sure if they even exist.  Is there an equivalent action to "Set Animation Time" that works in "Animator" (this is downloaded from the Ecosystem, it's not the included "Animation" actions)?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: "Set Animation Time" equivalent in Mecanim?
« Reply #7 on: June 24, 2015, 08:28:26 AM »
Hi,

 Yes, it exists, its the action "AnimatorPlay", where you set the normalized time of the state you want to play, that's the only way I know this can be done ( a Unity API restriction).

 but be careful, it's not reliable if your state has no transition, we heavily suffered last week on this because we wanted the animator state to "freeze" at the last frame of a state without transition, and it proved impossible, or else the technic isn't detailed anywhere.

Bye,

 Jean