Same rotation script affecting different parts of model in different ways.

I am trying to design a game, obviously, but at the moment I am trying to compile various scripts instead of working toward a finished product.

I ran into a problem on a generic mech-type model I created in Blender. Using Unity’s generic MouseLook.cs script, I wanted to be able to rotate the just the cockpit of the mech. However, when run, the mouse will have no effect on the cockpit’s rotation until about 10 seconds after starting.

When the same script is attached to the entire mech, and not just the cockpit, the mech will rotate immediately after starting.

Does anyone know the cause and/or workaround for this issue? Thanks

it’s weird. The unique cause that comes to my mind is that your model has a 10s animation with keyframes in the same position/rotation, preventing his movement by code. As long all animations are defined to “play automatically” by default it would explain this behavior.

Could be this your problem?

I found another solution. I created an empty GameObject named CockpitControl, and simply put it between the mech and the cockpit. (Mech is the parent of CockpitControl, which is the parent of Cockpit). Then I attached the MouseLook.cs script to this gameobject instead of the cockpit.
For some reason, this hierarchy change seems to have fixed the issue. The animation may still have something to do with it.