I've written a simple script to detect when the player object makes contact with another object. I only want the script to execute when the object with the player tag is the trigger. Code (csharp): function OnTriggerEnter (other : Collider) { if (other.CompareTag ("Player")) { PlayerScore.score = PlayerScore.score-damageMultiplier; } } My problem is I'd like the object with the script to maintain it's rigid body properties, but IsTrigger disables this. When I try to use OnCollisionEnter instead I get a Script Error that seems to be associated with trying to identify the tagged player object. Can anyone tell me what the syntax would be to use OnCollisionEnter with an if statement identifying the object with the player tag? thanks Kevin [/quote][/code]
Code (csharp): function OnCollisionEnter( collision : Collision ) { if( collision.gameObject.CompareTag( "Player" ) PlayerScore.score = PlayerScore.score-damageMultiplier; } Hope this helps