Can't use Vector3 twice on a sigle rigidbody ?

I have the script placed on a rigidbodie object directly however it will only allow me to use one of the input commands, i’m probably missing something simple here in regars to Vector3’s but can’t figure it out as of yet ?

//script to rotate rigidbodie across two axis

var frontBackForce : int = 999;
var sideForce : int = 999;

function FixedUpdate () {

   var xRotation : float = Input.GetAxis ("Vertical")   * -frontBackForce * Time.deltaTime ;
   
   var zRotation : float = Input.GetAxis ("Horizontal") * sideForce       * Time.deltaTime ;
   
   rigidbody.angularVelocity = Vector3 (xRotation,0,0);
   
   rigidbody.angularVelocity = Vector3 (0,0,zRotation);
      
      
}

It’s just basic programming. X=5; X=3; will leave you with a value of 3. Same way, if you use = on angular velocity twice, the last one wins.

You could use = for the first (which kills any old value,) then += for the second. So the final result is x+z. Or could just set them individually: rb.aV.x=xR; rb.aV.z=zR; rb.aV.y=0;

In C3, you have to use the “pull out” trick – copy out to your own vector3, change than, then copy back: Vector3 AV = rb.Av; Av.x=... rb.Av=AV;. C# forbids changing x,y,z directly of thing like velocity and position.