I want the player to teleport when touching lava. Here is my script i have applied to the lava
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Lava : MonoBehaviour
{
public Transform player;
public Transform spawn;
void OnTriggerStay ()
{
player.position = spawn.position;
}
}
If i use OnTriggerEnter it doesn’t do anything. If i have it at OnTriggerStay my character freezes in place and can’t move. I have isTrigger enabled.