Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: noxqs on August 05, 2013, 10:57:57 AM
-
Hi PlayMakers,
I found a weird but unwanted behavior.
Imagine a Dota (or Diablo) style game with a hero and monsters, all with animation.
During battle, I apply damage after a full attack animation cycle using the finish event in the play animation action. This way the damage is increased as the animation speed is increased.
This works fine if the characters are in camera view or if the scene camera and the scene window is open.
If the characters are not in camera view, the animation never finishes, never fires of the finished event and they never apply damage, never die and build up an immortal army which only seems to kill the framerate.
If during the game I move the camera back the animation cycles fire of the finish event again.
I have their animation wrap mode set to Once.
Any idea ?
-
I had some similar problems over here:
http://hutonggames.com/playmakerforum/index.php?topic=3825.msg17782#msg17782 (http://hutonggames.com/playmakerforum/index.php?topic=3825.msg17782#msg17782)
''Unity includes the Scene View camera when checking visibility''
Maybe related to your problem?
-
Hi dlmrky, thanks for replying.
It probably is related, maybe the animation actions only fires off the finished event if the gameobject is visible ?
Could anyone confirm this?
The only time finishEvent is set in the PlayAnimation action is at line 109:
if (!anim.enabled || (anim.wrapMode == WrapMode.ClampForever && anim.time > anim.length))
{
Fsm.Event(finishEvent);
Finish();
}
-
On your object, change the Culling Type of the animation component to "Always Animate", it is set to "Based on Renderer" by default.