Here is the code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class CollisionHandler : MonoBehaviour
{
void OnCollisionEnter (Collision other)
{
if (gameObject.tag == "Spikes")
{
reloadlevel();
}
else
{
Debug.Log("sae");
}
}
void reloadlevel()
{ int currentSceneIndex = SceneManager.GetActiveScene().buildIndex;
SceneManager.LoadScene(currentSceneIndex);
}
}
I can get it to work with an object that does not have a character controller. How do I get it to work with one?