playMaker

Author Topic: Play animation not finishing  (Read 10448 times)

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
Play animation not finishing
« on: December 17, 2013, 10:41:01 AM »
Hi ever since updating to unity 4.3  I've had issues with the play_animation action not casting its finish event.   This happens both with the action referring to a dynamic object and animation, but also to action being used to trigger an animation of a regular known object and animation. 

The weird thing is,  just after a seemingly random period the script will kick back in and continue, (like 30 seconds later).   I've had this in a few scripts, I've been solving it by added simple send events with a roughly correct delay.  But its nagging at me that there's something wrong with either unity 4.3 or the play animation action.   

Using legacy rigs by the way, perhaps that could be an issue?

Anybody else have this??

cheers..
tomas
« Last Edit: December 30, 2013, 10:32:56 AM by muppetpuppet »

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
Re: Play animation not finishing
« Reply #1 on: December 20, 2013, 05:59:04 AM »
I think it's to do with the animation culling based on renderer.  Could it be since this changed in the 4.3 update, that it no longer triggers an event when the animation is culled??

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
Re: Play animation not finishing
« Reply #2 on: December 21, 2013, 04:29:18 PM »
anybody has any clue?   it's popping at random at relly varied uses of the play animation action.  the finish action just doesn't finish..  It could also just be a new unity bug...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Play animation not finishing
« Reply #3 on: December 26, 2013, 08:37:56 AM »
Hi,
 
I would try on a very specific set of animations, maybe its your anims setup, is it happening always with the same anims or randomly through anims?

bye,

 Jean

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
Re: Play animation not finishing
« Reply #4 on: December 27, 2013, 08:07:00 AM »
Hi

I've got a sneaky suspicion it was me caused by clamp forever type animations.. strange thing is, this hadn't happen up until a few weeks ago..

I also get animate float actions, just skipping to 100% in one frame.. 

But perhaps its just my paranoia as the project hits that magical level of complexity where stuff just gets weird.. 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Play animation not finishing
« Reply #5 on: December 28, 2013, 02:53:50 AM »
Hi,

 Magical level of complexity... I see exactly what you mean, well put :)

Bye,

 Jean

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
Re: Play animation not finishing
« Reply #6 on: December 30, 2013, 10:32:40 AM »
well a little more info,  it seems when a play animation on legacy rigs is played, the finish or loop events are not triggered IF there are actions preceding that are finked as every frame.. 

This was not the case before 1.7  there I could use the finish event of an animation to end a more complex state. (so basically i'm playing the animation and setting the position and such of other objects during the animation state with "every frame" settings). 

does this ring a bell??  I've attached a screengrab of the state, and the animation was  simply not playing or hidden for some reason, or finished playing, it's like the entire object is culled while in this bug.

in the screengrab I set the play animation as first, but originally it was last..  I am activating the game object that's animating in the same state, but just also made a version where I activate one state before and only play in the state with the same results..

And here's the magical part..  when I switch from camera to scene view while playing,  it suddenly finishes the state.. for real!!..

stumped.....
« Last Edit: December 30, 2013, 10:34:50 AM by muppetpuppet »

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
Re: Play animation not finishing
« Reply #7 on: December 30, 2013, 10:39:44 AM »
OKEY I FOUND THE ISSUE!!!.  when I change the culling type in the animated game_object to animate always, there is no problem..  But when I set it Based on Renders it goes haywire.. Probably because the pivot orbounding box of the object is out of fustrum, until it animates..   and when its culled the play_animation doesn't finish.

But unity changed something in 4.3  it used to be you als had the option culling based on bounding box,, which never gave this issue..   

Is it possible there's something unity did, or something that needs updating in the play animation event to adapt to this change by the unity guyrs

Or is it possible to provide an alternative Play animation, that has a manual timing input, sort of a timed finished over-write, as a work around?? to sort of simulate the time it would take to animate, even when it's culled. (basically based on animation time)..

The get animation time action, should be able to do this, but it always seems to return zero 

cheers
tomas

p.s here's the "old" unity ref page on bounding box animation culling: http://docs.unity3d.com/Documentation/ScriptReference/AnimationCullingType.BasedOnClipBounds.html

but it's disabled now..

also, same problem with generic rigs
« Last Edit: December 30, 2013, 10:43:09 AM by muppetpuppet »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Play animation not finishing
« Reply #8 on: January 02, 2014, 05:32:02 AM »
Hi,

 Add a wait action to the state that use the play animation, then you can have any timers based on your own values.

bye,

 Jean

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
Re: Play animation not finishing
« Reply #9 on: January 02, 2014, 07:55:42 AM »
Hi,

I've done this, and i'll probably code something, to calculate the proper wait time, based on the animation time, in a custom version of the play animation action..


However I'm noticing more weird issues, including gameobjects being stuck in an animation after being activated-deactivated-activated again.  I'm wondering if playmaker has already updated the setactive.recursive  to the newer unity 4 code.?  seing as the recursive option has changed in unity4.  Are we still working with the obsolete code? or has this been updated.??  it could be there's some discrepancies between the new and old system of setting game objects active.



jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Play animation not finishing
« Reply #10 on: January 02, 2014, 09:40:51 AM »
Hi,

 as far as I know, activation is all up to date, else you would get a warning in the Unity console.

bye,

 Jean

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
Re: Play animation not finishing
« Reply #11 on: January 02, 2014, 11:33:12 AM »
aaah cool,  good to now,   I'll delve deeper, see if i'm doing something weird with my pools.. I've stopped using prefabs for object pooling, as per the sticky post in the bugs forum.   Perhaps because a object in the pool is not cloned or instanced from a prefab (but from an existing source object in the scene), stuff might not reset properly.. (actually, I'm going to ask one of the real programmers here about this,, reached my noobceiling here)


This is where things usually go wrong with visual scripting with me, you have an issue, which is probably logical and fixable, but its probably caused by a chain of events which is logical in your visible scripting, but not logical in the underlying codebase..     And stuff gets weird. :o

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Play animation not finishing
« Reply #12 on: January 02, 2014, 03:02:41 PM »
Hi,

 You have a good point. Visual scripting hides away some very important information sometimes, and not carefully studying the actions you are using can lead to mis understanding and mis use leading to some pretty tensed debugging sessions :)

That's why ( even if I can study and understand the custom actions code), I always try to simplify and optimize my Fsm to do as little as possible, then identifying issues is a lot easier than crowded states and overwhelming Fsms that deserves being cut in several smaller Fsm.

 On top of that, brings all the usual issues linked to bad animations set up, Unity versionning and evolution and it's becoming quite problematic sometimes.

Always ask on this forum if you are not sure what an action does and behave, we'll try to describe it and lift all uncertainties.

Bye,

 Jean

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
Re: Play animation not finishing
« Reply #13 on: January 02, 2014, 04:49:26 PM »
thanks, willdo..