- Home /
3RD person controller animation problem
Heey, i'm using the 3rd person controller prefab for my own character model. But i get this error: Multiple visibility culling animations in the same hierarchy, animation culling for animation component in 3rd Person Controller will be turned off.
I changed everything i should change (as far as i know)
Here a description of what exactly i have done: I made a boned model in cinema4D all moves in one file, exported as fbx and imported to unity. I splitted the animations in the inspector, and gave them all the right name. I dragged it to the scene hierarchy as a child of 3rd Person Controller. In the inspector for the 3rd Person Controller i overwrited all the current animations with my animations (same names and same positions) and when testing i get the error.. anyone knows how to fix this??
Answer by Ilias · Mar 12, 2011 at 03:18 PM
You need an animation component, and drag all the animations in the component.
by example; If you have 5 animations for the model. ani 1: Idle ani 2: Walk ani 3: Shoot ani 4: Crouch ani 5: Reload
Resize the size into 5 and drag all the animations in the elements. Make sure the Animations are playing automatic.
Use the JS:
var minimumRunSpeed = 1.0;
function Start () { // Set all animations to loop animation.wrapMode = WrapMode.Loop;
// Except our action animations, Dont loop those
animation["**(the animation name of the animations of the player)**"].wrapMode = WrapMode.Once;
// Put idle and run in a lower layer. They will only animate if our action animations are not playing
animation["(the animation name of the animations of the player)"].layer = -1;
animation["(the animation name of the animations of the player)"].layer = -1;
animation["(the animation name of the animations of the player)"].layer = -1;
animation.Stop();
}
function SetSpeed (speed : float) { if (speed > minimumRunSpeed) animation.CrossFade("(the animation name of the animations of the player)"); else animation.CrossFade("(the animation name of the animations of the player)"); }
Your answer
Follow this Question
Related Questions
Can I make animations snap to a frame? 1 Answer
Third Person Controller animation problem 1 Answer
How to select an animation clip by index number? 7 Answers
How to add attack animations to the third person controller script? 1 Answer
How do I assign my own character to a 3rd person controller? 1 Answer