Hi, I’m trying to make a that when the BoxCollider hits the wall, that it changes “IsColliding = true”. The code won’t simply work.
Yes, I added a new tag, and the walls are asigned to the tag
Code:
function OnTriggerEnter (theCollider : Collider)
{
if(theCollider.tag == "PlCol")
{
IsColliding = true;
}
}
function OnTriggerExit (theCollider : Collider)
{
if(theCollider.tag == "PlCol")
{
IsColliding = false;
}
}
One of the objects in the collision needs to have a rigidbody attached, according to this.
Try putting a Debug.Log statement in both of the OnTriggerEnter calls to see if it’s registering the collision at all.
I have tried puting rigidbody to the walls and nothing. And yes, I have tried “Debug.Log” and it doesn’t detect it at all. If you need more detailed info just ask
Is either set of colliders marked as “Is trigger”? If not then OnTriggerXXX events won’t get called, and you will need to use the OnCollisionXXX events instead.
Don’t want to sound rude but I’m not that stupid. Of course I set on trigger the box. OnColission? Can you give me a code example, because I’m away and low on internet so I can’t seach currently. And yea, Thank you 
Then please list everything that you already know so that I can avoid offending you while trying to help. You’re welcome 
My mistake. Anyway, this is the current code, and it doesn’t work :
function OnCollisionEnter (Col : Collision)
{
if(Col.gameObject.name == "Wall_Normal_01")
{
drawGUI = true;
Debug.Log("Test");
}
}
Note: The Collider (BoxCollider) is attached to a spotlight, and that spotlight, contains the script.
I seem to have missed why you’ve switched from OnTriggerEnter to OnCollisionEnter. Either way, OnCollisionEnter is not sent for triggers. You can see which messages are sent by referring to the matrix at the bottom of this page.
In any case, to settle this issue, here’s a short script that will most definitely work.
using UnityEngine;
using System.Collections;
public class TriggerVisualizer : MonoBehaviour {
void OnTriggerStay(Collider col)
{
Debug.Log(string.Format("Trigger colliding at time {0} with object {1}", Time.time, col.gameObject.name));
}
}
Attach this to a game object that has a trigger collider attached and a rigidbody. Set the rigidbody to isKinematic. Create a wall, or whatever, that has a collider attached (trigger or non-trigger, but it does not need to have a rigidbody). Push play, open the Scene window and drag the trigger object overtop of the wall. The messages will be sent.
If you need any more clarification feel free to ask!
Erik
Will try, thanks for help 