So basically I want to reset a rigidbody object’s position to it’s original state without actually restarting the level. I have a character which can move the rigidbody object and when he falls down, (this is where the collision takes place) I want the rigidbody object to go back to it’s original position. Now, the problem I am facing is that, when the collision happens, the rigidbody object does not change it’s position as I have defined in the script. Instead it get’s teleported somewhere else in the scene which is weird. I am very much new to scripting and it would be really nice if someone could help me out. Thank you in advance.
function OnTriggerEnter (other : Collider) {
if(other.tag == "Player"){
GameObject.Find("cuber").transform.position = Vector3(34, 0, 0);
}
}