x


Cheapest way to catch collisions on very fast moving objects...

Hey guys,

For our current project we need to catch collisions on objects that can be moving very quickly in opposite directions.

We're using non-kinimatice rigidbodies on both objects, one with a capsule collider and the the other with a box collider...

One object moves via translation, the other via velocity.

Most of the time this works fine, but It seems that sometimes an object can go straight through the other without colliding properly when both are at high speed.

Any suggestions on the cheapest way of solving this, is the only option to use continous dynamic collision detection on one of the rigidbodies?

Thanks in advance guys :)

more ▼

asked Mar 29, 2011 at 07:10 PM

demize2010 gravatar image

demize2010
1k 57 48 65

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Maybe you find some enlightenment on the awesome DontGoThroughThings Daniel's script. From my brief experience, the new physics improvement on Unity 3, collisionDetectionMode, still doesn't work as good as this raycasting implementation. For sure, neither is 100%, but this was pretty close on my case:

This script uses raycasting to avoid the physics engine letting fast-moving objects go through other objects (particularly meshes).

So it solves the issue of "objects moving very quickly" in the very practical instance of crossing walls that it never should be able to. You could extrapolate this script into one able to detect another object moving really fast.

The problem exists even if you use continuous dynamic collision detection because fast moving objects can move so fast that they are too far apart from itself from one frame to the next immediate frame. It's like they teleported and no collision detection would ever be triggered because no collision existed, from each frame perspective, and thus from all calculations processed.

more ▼

answered Mar 29, 2011 at 07:40 PM

Cawas gravatar image

Cawas
2.3k 116 113 127

Nice one, thank you.

Mar 29, 2011 at 07:43 PM demize2010

The real issue comes when the wall is moving too :P Am currently trying to solve it

Jul 20, 2012 at 12:21 PM Izitmee
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4312
x1130
x76
x61

asked: Mar 29, 2011 at 07:10 PM

Seen: 10701 times

Last Updated: Jul 20, 2012 at 12:21 PM