Moving Trigger - Collider problem

Hello there
i have these problem , in my scene I create player and cube collider(trigger) i add to player .
My idea is to make only one collider which will be something like distance check.
So if NPC with Q is in player distance check collider set variabile to true and let the
Quest info pop-up. But it doesnt work … variabile wont turn to true

here is my scripts
first one distance check

static var nearNPC = false;

function Start () {

}

function Update () {

}

function OnTriggerEnter (other : Collider)
	{
 		if (other.gameObject.CompareTag ("TalkingNPC")) {
		nearNPC = true;
		}
	}
	
function OnTriggerExit (other : Collider)
	{
 		if (other.gameObject.CompareTag ("TalkingNPC")) {
		nearNPC = false;
		}
	}

second one … do something

var clicked = false;
var endedQ2 = false ;

function OnMouseUp () {
    clicked = true ;
}

function OnGUI () {

		if( clicked == true   endedQ2 == false  PlayerDistance.nearNPC == true)
	{
 and blah blah blah...

clicking on gameObject work properly

thanks :slight_smile:

I normally use print to check if colliders are triggered. Do you have a rigidbody attachde to one of the objcts, remember that you must have at least one…

yes i forgot that ! thanks man :slight_smile: i dont really think about mistake on that place :slight_smile: