After looking around, I haven’t quite found anything resembling my apparent issue. I have a character object that uses a kinematic rigidbody and colliders that act as triggers for non physics based collision detection. That works fine.
I have a trigger that is set up for changing a text object that displays on the foreground of the screen. The character detects this and the code allows movement through the trigger. A separate script on this same character object is set up to change the text upon detecting the trigger, but even though it uses the same exact code for detecting the name of the trigger as the movement script does, no collision is detected.
Can only one script on a object detect triggers? I’ve used Debug.Log to confirm that the character detects the collision in the movement script, but no collision is detected in the texthandler script.
I really want to be able to handle various collision types through separate scripts, but I don’t understand why this is the way it is.
void onTriggerEnter(Collider col)
{
Debug.Log ("" + col); //shows in console in movement script, but not in other script
if (col.gameObject.name.Equals ("Tut1"))
{
//this is where the code would be executed
}
}