Problem with animation culling, animation event still firing
I am working on optimizing and I have set the culling mode on all my gameObjects with an animator to "Cull Completely". It just doesn't seem to work at all, if I look at my character in the scene view while playing my game I can see that the animation is still going on. I thought maybe this is just how Unity works so I tried to use an animation event to call a simple function with print ("I am still animating") and I can see it in the console even though the object is clearly not visible for the camera.
Can someone explain? - Thanks in advance
Answer by Molder · Aug 16, 2016 at 08:11 PM
yes same problem, 5.4.0f3 I have resolved in this way, for now.
setup the Animator like this: Inspector->Animator->Culling mode = Always Animate
create and attach a c# like this:
using UnityEngine;
using System.Collections;
[RequireComponent( typeof( Animator ) )]
public class CullCompletely : MonoBehaviour {
void Awake() {
Invoke( "Invoke_CullCompletely", 0.5f );
}
// TODO bug 5.4.0f3 check if resoved now
private void Invoke_CullCompletely() {
animator.cullingMode = AnimatorCullingMode.CullCompletely;
}
}
Your answer
Follow this Question
Related Questions
Trouble clicking event in animation timeline,Can't select animation event in timeline editor 2 Answers
How can I edit the animation I just created in Unity 5 0 Answers
How does Animator Culling work? 1 Answer
Animator Paramater bool wont return after setting it to false 0 Answers
Scope Animation doesn't work?! 0 Answers