Created
August 16, 2022 02:59
-
-
Save Mylab6/9454858bebe560ce8f2a909c77134e30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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