- Home /
Animate Character whilst applying "mouselook" script to a child
Hello i have a problem where i am pivoting the characters head with the mouselook script and applying a walking animation. The animation seems to override the script and continues to play animations is there anyway around this problem?
Answer by $$anonymous$$ · Nov 29, 2012 at 10:36 AM
If I understood your problem correctly, this is what might be going on.
Since you have applied a walking animation to the character, it is more than likely the animation contains animation curves for the head as well. (It doesn't have to animate the head). But if it does, then the rotations you apply from code (ie: mouselook script) won't work because the animation curve overrides those rotations.
To check if this is the case you can open up the animations tab from window->animation and check if the head has any animation curves on it (translate/rotate/scale). if you have any of those just select only those keys and delete them. (you may or may not have to select the root of the animated object or the actual head to see the animation curves depending on the way the mesh importer imported the animations)
Hope this made sense and is helpful.
Hey hdsenevi, yes that made lots of sense an was very relevant thank you.
$$anonymous$$y animations are read only anyway to make them wri$$anonymous$$ble??
Yes, there is.
Go and open up the actual mesh in Project window and inside there is going to be a animation file for each animation that you have imported from the mesh importer. One of those is going to be the read-only walking animation (actually all of them are read-only).
So what you have to do is, duplicate the walk animation and assign it to your model ins$$anonymous$$d of the default read-only one. Now you can edit the keys to your hearts content.
p.s : In the Animations editor (window->animation) when you select a model with couple of animations on them, you can choose which animation to edit from the drop down list.