How do I key only position x,not position y and not position z;

I wanna key only on positionx,but y and z will also be keyed.Is there any way to avoid this?

Keyed?

Guessing you’re trying to set a transform position?

e.g.

transform.position = new Vector3(5.0f, transform.position.y, transform.position.z)

Is that what you’re after?

Or if you’re just wanting to read x, then:

transform.position.x

I think he’s talking about setting keys in an animation. Unfortunately I can’t help, as I know little about them.

Ahhhhhhhhhhhh… ditto.

when you set a key on transform.position,position.x, position.y and position.z will all get key frames.Now I just ONLY want to key transform.position.x,but y and z dont need any curves.How do I do it?
animation will get a continuous movement,but script will not.