|
I have a cylinder using a mesh collider and rigid body. I also have 2 blocks(cubes) as goals. The cylinder's tag is "SodaCan" The block's tags are "Goal1" and "Goal2" I created a script called "GoalDetection" and attached it to "Goal1" and "Goal2" GoalDetection uses this exact code:
My problem is that even when the soda can is right on top of either goal "Goal Scored" is not printed. Does anybody know any solutions or what i did wrong? I am using unity iphone
(comments are locked)
|
|
http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.OnCollisionEnter.html You probably need to capitalize the 'O', like this: it didn't work.
Jun 06 '10 at 05:17 PM
Aspyn palatnick
Do you have triggers set up on your goal objects? I.e. colliders with the "is trigger" checkmark added?
Jun 06 '10 at 07:34 PM
Tetrad
No should I put a trigger?
Jun 07 '10 at 08:40 PM
Aspyn palatnick
Re-read the documentation I linked to you, specifically this point: "OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider." So if your goals don't have either rigidbodies or colliders, OnCollisionEnter won't get called.
Jun 07 '10 at 10:26 PM
Tetrad
(comments are locked)
|
