So I’m making a car game with my friends for a school project, and if you want and or need to respawn I was thinking of doing so that when you press “K” you respawn at wanted location and in the right direction. I’ve gotten the position right so that it should spawn where I wanted, but I can’t get the direction script to work. So my question is, where am i going wrong with the rotation lines and as I’m using “this”, will do the things to the car if I attatch the script to it. I’m using the public variables so that I can edit them easily w/o opening mono. I’m no pro so don’t judge please
public class BilKeyRespawn : MonoBehaviour {
public float x;
public float y;
public float z;
public float a;
public float b;
public float c;
void Update() {
if (Input.GetKeyDown (KeyCode.K))
this.transform.position = new Vector3 (x,y,z);
this.transform.rotate = new Vector3 (a,b,c);
}
}