Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know this question has been asked several times but none of the answers solved my problem.

I made an sphere and gave it rigidbody. then I draged the sphere on to a new made prefab.

on mouse-click Instances of this prefab are made and shot. the spheres collide with things in the scene but the onCollisionEnter function is not called. all things in the scene have colliders.

I would be grateful if you could tell me what's wrong

edited: it works if either the sphere or the other object's collider is trigger and I use onTriggerEnter.

share|improve this question
1  
Is this kinematic rigidbody? – SanSolo Jun 20 '15 at 16:39
    
Set collision detection to continuous and check – SanSolo Oct 20 '15 at 3:43

I believe this happens because the bullet's speed is very fast so the collision doesn't have enough time to be detected, that's why I prefer using raycast for the shooting.

share|improve this answer

Since you mention onCollisionEnter, could it be a typo? because, the function is written OnCollisionEnter (upper case O)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.