Hey,
I set up an empty GameObject and attached a Box Collider as a Trigger (2D Game).
Afterwards i attached the following script to the GameObject:
using UnityEngine;
using System.Collections;
public class boxSideCollider : MonoBehaviour {
void OnTriggerEnter(Collider other){
Debug.Log ("Enter");
GameObject player = GameObject.FindGameObjectWithTag("Player");
player.GetComponent<CharControllerScript>().Dead();
}
}
Neither the logtext nor the other code appears/works when the character is entering the zone.
Can somebody help me? Thanks!