Hey everyone,
I wanted to add a function to reset the rocket position, rotation, and stop its velocity when I press the ‘R’ button and figured it out! Feel free to use it.
Vector3 startingLocation;
void Start {
startingLocation = transform.position;
}
void Update {
ResetPosition();
}
private void ResetPosition() { //reset Position on landing pad
if (Input.GetKey(KeyCode.R)){
transform.position = startingLocation;
transform.rotation = Quaternion.identity;
rigidBody.velocity = new Vector3(0,0,0);
}
}