rotate animation

Hi,

I am unsure of the best way to rotate an animation.
I just want to press the left key and have the animated model face left. Currenly it moves fine .

I have gameobject (animation) with 3 children which are 2 child objects part of the animation and a camera. If I change the y rotation value of 1 of the animation children it turns and the camera stays put.

//this turns the object left and the camera as well which I dont want.
transform.eulerAngles = new Vector3(0, -90, 0); 

//this turns it left but on every frame so it spins around on every left key press.
transform.Rotate(0, -90, 0); 

I think the answer might be here.

If you want the rotation to be instantaneous, you can use transform.Rotate when the input is pressed (and only then, so it’s done once).

If you want it to be animated, you need to rotate over time. You can use coroutines for that. I could write it for you, but I suggest you try yourself first.

Important : If the animation’s component is on the highest transform, the one that you want to rotate, you must not play an animation clip that contains keys on the rotation, or it would override your modifications.

Ok I solved it. I will place this an answer.

Transform child1;
child1=transform.Find(“model1:Master_CTRL”);

child1.transform.eulerAngles = new Vector3(0, -90, 0); //face left

If I cant do this or there is a better way then let me know and I will delete this post.