|
I have a Child named Waypoint of the game object player and the other child PlayerObj moves towards Waypoint. The Enemy has a mesh on it with the renderer turned off and the trigger turned on(the script attached to it is below). The problem is when the PlayerObj collides with the mesh on the enemy it doesn't recognize it, any idea why would be very helpful. var Target : String; function OnTriggerEnter (Enter : Collider) { }
(comments are locked)
|
|
http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnCollisionEnter.html Note that collision events are only sent if one of the colliders also has a non-kinematic rigid body attached. http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnTriggerEnter.html Note that trigger events are only sent if one of the colliders also has a rigid body attached.
(comments are locked)
|

does PlayerObj has a Rigidbody component attached?
no it does not at the moment
1st thing that comes to my mind is if all the objects have colliders.
after that check ur code without the condition if. if it works try placing the condition agian, and make sure ur tag is correct.
try to print something inside the if to see it it works like print(1); this will make the console print 1 if the condition works.
gl