How to get multiple functions work on the same time.

HI.

I have problem with to get multiple functions work on the same time, I have this piece of code

    var turnSpeed = 1;
    var moveSpeed = 3;
    
    function Update () {
    	if(Input.GetButton("Fire1"))
    	{
    		transform.Rotate( -turnSpeed, 0, 0 );
    		transform.Position( Vector3(0,1,0) * moveSpeed * Time.deltaTime);
    	}
    }

I get the transfor.rotat to work but not the transform.position to work but if I only transform.position it works fine. How do i get both functions work on the same time?

transform.Position doesn’t exist. Try transform.Translate instead.

I’m guessing you want to use:

 transform.Translate(Vector3(0,1,0) * moveSpeed * Time.deltaTime, Space.world);

Which will ignore the rotation of the object when moving the position and use world coordinates instead.