Ok im about to tear my hair out in frustration…
Im trying to make a simple, simple, simple hit test collision between two geometry objects using tags. So far im having no luck at all!! garr!!
can someone please point me in the right direction or even show me what the code should look like?
any help would be great 
cheers.
-
If you are using a CharacterController, only the CharacterController will trigger a collision message on itself (OnCharacterControllerHit with automatic argument hit : ControllerColliderHit).
-
If you are using two objects with colliders, make sure the gameobject going in the second object has a rigidbody with isKinematic off. (moving object has collider and rigidbody, static object has collider). On both objects functions OnCollision (Enter, Stay, Exit) will be triggered, with argument collisionInfo : Collision).
Whatever the case is, you can/must use the argument given (hit or collisionInfo). You can retrieve the gameObject having triggered the message (hit.gameObject, or collisionInfo.gameObject) and from there, retrieve its tag.
For when your character collides with something with tag “TagName”
function OnControllerColliderHit (hit : ControllerColliderHit){
if (hit.gameObject.tag == "TagName") {
do something;
}
}
Cheers guys,
thank you for all your help, I think i have it all under control now. 