Im new to scripting so this is kinda newbie question
Why is the if statement in the Update() not working?!? i know the arraylist is working because i can see it changing in the editor. ![]()
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class BlockCollider : MonoBehaviour {
public List<Collider> colliders = new List<Collider>();
public Collider LeftSnap;
void Update()
{
if(colliders.Contains(LeftSnap)) /// THIS IF STATEMENT JUST DOESNT WORK :(
{
Debug.Log ("THIS IS THE LEFT");
}
}
void OnTriggerEnter(Collider c)
{
if(c.tag == "LeftSnap" || c.tag == "RightSnap")
{
colliders.Add(c);
}
}
void OnTriggerExit(Collider c)
{
if(c.tag == "LeftSnap" || c.tag == "RightSnap")
{
colliders.Remove(c);
}
}
}
‘LeftSnap’ is a empty gameObject with a box collider as a trigger attached
EDIT THIS IS FIXED ![]()
Any help appricated ![]()