Skip to content

Instantly share code, notes, and snippets.

@Mylab6
Created August 16, 2022 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mylab6/9454858bebe560ce8f2a909c77134e30 to your computer and use it in GitHub Desktop.
Save Mylab6/9454858bebe560ce8f2a909c77134e30 to your computer and use it in GitHub Desktop.
using UnityEngine;
public class BasicPositionReset : MonoBehaviour{
public UnityEngine.Vector3 startPos ;
public UnityEngine.Quaternion startRotation ;
void Awake(){
startPos = transform.position ;
startRotation = transform.rotation;
}
void Update() {
if (Input.GetKeyDown(KeyCode.Keypad0) )
{
Reset();
}
}
void Reset(){
transform.position = startPos ;
transform.rotation = startRotation;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment