- Home /
Model rotation and hierarchy of game objects - not rotating!
Hi all, I'm new to unity3d but have programmed 3D apps before. I have a hierarchy like this:
Player
- body
- shorts
- shoes
Player, body, shorts, and shoes are all GameObjects. Player is used just as a container and is the parent of the other parts. Each of the children has a Mesh and a Mesh Renderer. I am trying to rotate the entire player so I thought I could just modify the rotation of the Player transform. I can see the y-value of the rotation changing in the inspector when I run my script but the 'model' does not rotate. I can't understand why this doesn't work.
Am I missing something unique to unity? Thanks
It would best if you could post the snippet of the code when you are trying to rotate your object..
Here is the Update in the script:
void Update() { transform.Rotate(0,45 * Time.deltaTime, 0); }
The script is a component of the 'Player' object.
Solved! I rebuilt my hierarchy and re-added all of my meshes and it just worked like I thought it should. Not sure what went wrong the first time.
@$$anonymous$$ichael as it should in a first place.. so you might want to remove the question since it's probably a bug.. :)
Answer by Jaap Kreijkamp · Mar 15, 2010 at 11:12 PM
The player has an animation that modifies rotation and position of the object itself, so the animation overrides any changes you make. The solution, make the player a child of another gameobject and do moving, rotation on this one.