Can I control object rotation on playing animation?

Can I control object rotation on playing animation?

I’ve always been thinking that affected animation node does not control.

Was I wrong?

the node is playing animation now. however I was able to modify parameter by following this code.

function Update() {
    transform.rotation = 
        Quaternion.Euler( defaultEuler.x + x, defaultEuler.y + y, defaultEuler.z + z );
}

I tried made a same situation by using easy object(cube premitive object).

But object does not move. Parameter follows animation.

I’m not sure this cause.

and, Object that I can control rotation on playing animation does not move by using this code.

function Update()
{
    transform.rotation = Quaternion.Slerp( 
        transform.rotation,
        Quaternion.Euler( defaultEuler.x + x, defaultEuler.y + y, defaultEuler.z + z),
        Time.deltaTime * chaseCameraSpeed );
}

Object state that shaking slightly(Brr). I’m not sure really…

Can I control object that affected by playing animation?

Your English is a little weak, but I think adequate. The question needs more details about the set-up.

Most animations were created in a modelling program, on bones. Since you’re talking about a Cube, I’m guessing that you created the animation using Unity’s animation window, and added it to the Cube, as a Component.

Animations fully control the rotation/transform of the object they are on. They run after Update (and before LateUpdate,) so they override your Update code. The trick is to animate the child and code-move the parent:

square <- empty game object. Update script can move this
  Cube <- cube made in Unity. Has animation component

hey, i want the animation of the cube which is a simple rotate to be played only when i clic on left mouse! how can i do that ? help please and thank you

public animation anim;

 if (Input.GetMouseButtonDown(1))
        {
            anim.Play("NameOfTheAnimation");
        }