- Home /
Can not get value out of a collision
Hey all, I did not get to make an object, such as a car, when faced with an object box appears on the screen of the 200, the problem is that when the AI car collides with this box, the screen displays the number 200, and the need to number 200 appears only when my car touches the box. The box has a trigger collision.
Comment
Please rewrite your question, i really don't understand what your problem is.
Your question sense is cannot making? New words please post, with more question describe ask?
Best Answer
Answer by save · Oct 05, 2011 at 02:31 PM
The trick is in checking if the colliding object is the player:
function OnTriggerEnter (other : Collider) {
if(!other.CompareTag("Player")) return;
//Rest of your code goes here
}