My on trigger enters are not working yet my box colliders are tagged and is set to is trigger. Does there seems to be a problem with my code? I am trying to reset the players position.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class resetscript : MonoBehaviour {
int score;
public Text count;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void OnTriggerEnter (Collider other) {
if (other.gameObject.CompareTag ("reset")) {
transform.position = new Vector3 (46, -5, 26);
}
}
}
Have you attached Rigidbody to one of the colliders?
– KuR5