I am Trying to make the scene reset or reset my player position when it collides with "lava"

private void OnTriggerEnter(Collider other)
{
gameObject.transform.position = new Vector3(0, 5, 3);
}
that’s my code but it’s not working.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class death : MonoBehaviour
{

private void OnTriggerEnter(Collider other)
{
gameObject.transform.position = new Vector3(0, 5, 3);
}

}
thats the full code

you use the wrong event

1 Like

it’s still not working
void OnCollisionEnter(Collision collision)
{
gameObject.transform.position = new Vector3(0, 5, 3);
}

yes, you need to take the collision.gameObject not the gameObject which you collide with i would gues :slight_smile: