|
Is there any other was to detect collisions between two objects other than this:
The problem with that is that it requires one of the objects to be a trigger meaning that physics do not apply to it. In the context of my application it means one object will pass through another which i don't really want. Thanks in advance
(comments are locked)
|
Description OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider I actually looked at this earlier but it didn't seem to work. Is there something about the objects that I have to change? It just never says "hit"
Jun 20 '10 at 02:34 PM
ROM
Maybe you don't have colliders/rigidbodies or they're triggered..
Jun 20 '10 at 02:35 PM
AnaRhisT
I'm using a sphere and box collider. The following code is applied to them: function OnCollisionEnter(collision : Collision) { print("hit1"); if(collision.gameObject.tag=="Player"){ print("hit2"); } } Neither hit1 or hit 2 are printer. its rather odd.
Jun 20 '10 at 02:41 PM
ROM
Check if they're trigged. if they're not, try to use a rigidbody.
Jun 20 '10 at 02:43 PM
AnaRhisT
How odd, I use rigidbody on one of them with the default settings and it works. I change the settings so the block doesn't move and it stops working. Hmmmmm...
Jun 20 '10 at 02:52 PM
ROM
(comments are locked)
|
|
You can use OnTriggerenter, OnTriggerStay, OnTriggerExit, OnCollisionEnter, OnCollisionStay, OnCollisionExit :).
(comments are locked)
|
