- Home /
contuouse collision detection malfunction
hi . i need help with an old problem of mine .
1-make a wall.
2-make a bullet with box collider with fast speed that move towards wall.
3-bullet will pass from wall usually.somtime hit the wall, somtimes ignore wall , in more speed it always ignore wall!!!!!
i checked and changed all of this :
1-physics options.
2-collider rigid body options .
3-collison detections(discrete, continuous collision ,continuous dynamic).
no change :(
i know that this issue most solve with continuous collision detection ,but not worked for me .
Answer by fafase · Apr 30, 2012 at 12:05 PM
Simple problem. At fast speed, let's say you have 500m/s with 50fps we have 10m/f
at t=0 pos.x =0
at t=1 pos.x = 10
at t=2 pos.x = 20 and so on
The movement is discrete. In between the bullet does not go. So if you are behind a wall and someone is shooting at you, this way the bullet does not collide with the wall but right before and after. So yuo get killed and it is wrong-
Use raycast instead or try to set your rigibody collision to continuous or continuous dynamic.
The reason is because you are moving. So sometimes, you are exactly 10m away and sometimes you are 11m away.
Answer by Kryptos · Apr 30, 2012 at 01:50 PM
Regarding bullets, the best way is to not use physics for the bullet but rather throw a raycast. If it is really high-speed, the player will not see it. So why bother creating a bullet?
If this bullet is spinning and stuff
Just add a random (but small) angle to the raycast direction.
because i try to solve this fact.this gap is also in the grenade. make a sphere and throw it as a grenade, SO$$anonymous$$ETI$$anonymous$$ES it goes into the floor!
Could you detail how the wall and ground are made of? I mean colliders and thickness of ground and any other relevant info.
a cube as wall. size= 9*4*0.3 . box collider .
a cube as bullet. size= .2*.2*1 . box collider . rigidbody:mass=0.05 .
a plane as ground .
Try to use a stretch box for the plane ins$$anonymous$$d and see if already that fixes your grenade issue. It seems like small objects and plane are a problem. http://answers.unity3d.com/questions/10145/rigidbody-sphere-falls-through-collider-plane.html. Primitive colliders are better than mesh colliders so see if there is any differences.
Your answer
Follow this Question
Related Questions
Collision Detection between instances of a prefab 0 Answers
hollow cone collider has no end caps 2 Answers
How can I have collisions as a point? 1 Answer
Avoid Player bouncing when colliding with objects 3D 1 Answer
Raycast goes through collider 2 Answers