- Home /
Why is my model jumping to position 0,0,0?
Whenever i run the program, the objects using this model (i know its a broken model, my rigger is still working on it) all jump to position 0,0,0. I dont know why and it doesnt give me any error messages. Also, the controls dont work.
The project can be downloaded here. Its a unity 3.1 project. http://www.megaupload.com/?d=B5QF76N0
Thanks in advance for any help.
EDIT: I uploaded the wrong project folder before. The new link is up...
I downloaded the project. In it is a scene of a capsule that I can move across a floor, with walls on either side. The camera tracks this capsule, and the movement is fine.
There are no other scenes in this project file. Can you expand on what the problem is? at a glance things seem to be working to me
The project folder i uploaded was not the one i was having a problem with... I'm smart... the new link is up.
Answer by Bunny83 · Feb 24, 2011 at 09:43 PM
Your problem is that you added another Animation component to your character. The Animation component on the parent is the wrong one. You only need/should have the one on the child object "udon_animations". The animation on the parent set's the parents position (and of course can't find the right child bones). You need to modify your scripts to se the Animation on the child object. Well, the easiest way i could think of is to add a public var an name it "animation" and assign the child Component to it.
public var animation : Animation;
Also set the enemys scale to the desired size in the editor rather than runtime or the bounds of the model go crazy.
Like I said, add a variable to your scripts where you need access to the animation and assign the childs animation component. To assign the component to the variable just select the parent where your script is, grab the whole child object and drop it on the variable. Because I used a typed variable unity automatically assigns the Animation component of the child to the variable. Unfortunately it seems JS don't allow to hide the inherited animation property, but C# does. It just throws a warning. In JS you have to name it differently and use your name ins$$anonymous$$d of "animation" in your scripts.