using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class OnTriggerEnterRidge : MonoBehaviour {
public bool IwantTheKamaticOff = false;
Rigidbody [] RidgeBod;
List <GameObject> Bricks = new List <GameObject>();
public GameObject Player;
// Use this for initialization
void Start () {
Player = GameObject.FindGameObjectWithTag("Player");
RidgeBod = gameObject.GetComponentsInChildren<Rigidbody> ();
}
// Update is called once per frame
void Update () {
if (IwantTheKamaticOff == true) {
foreach (Rigidbody rid in RidgeBod){
rid.isKinematic = false;
}
}
}
public void OnTriggerEnter(Collider other) {
if(other == Player){
Debug.Log("YOLO");
}
}
public void OnTriggerExit(Collider other) {
if(other == Player){
Debug.Log("YOLO");
}
}
}
My on trigger enter is not working and I don’t know why I have tried Ridgedbodys and everything else