- Home /
Collision detection for low relative velocity, high world velocity rigidbodies
I am having an issue with collision detection. This is not a question about high speed objects passing through each other. This is a question about two objects moving at high speeds in unison, basically two objects that exist in a local frame of reference (say for instance inside an aeroplane). The relative velocity of the two objects is low, with definite frame overlap which would trigger even discreet collision detection. The two colliders are triggers.
However; when the two objects start to move together (the aeroplane starts moving) the collisions become incorrect but predictable. One object has to be moved ahead of the other (in the direction of the planes movement) in order to "collide" leading me to believe that only one object is failing to update correctly, even though in inspection the colliders are in the correct positions.
The objects do not fail to collide, they just collide in the wrong place. Consistently one of the objects has to be ahead of the other, and as the speed increases, this distance ahead must increase to maintain collision detection (using OnTriggerStay).
Answer by Kwergan · Jan 09, 2018 at 02:56 AM
For some reason OnTriggerEnter fixes this problem and I still need continuous dynamic collision even though the collisions appear discreet.
Answer by sparkzbarca · Jan 08, 2018 at 04:16 AM
I know your saying they have low relative velocity but i'm not sure they do.
It is dependant on the order of operations which physics performs.
if physics moves all objects, then detects all object collisions your correct, if however it does it on a per object basis where an object moves, does detection, then another object moves, does detection.
There exists only one "local space" and that is on a per object basis.
if your talking about compound colliders for a aircraft simulator though, i think this issue is somehow fixed with fixed joints.
I've tried using joints but this didn't seem to fix the issue. All my operations for moving the triggers are in fixedUpdate. One trigger is fixed to the Aircraft with joints while the other is attached to another object via fixedUpdate. It's strange because the colliders appear to be intersecting, even if I run frame by frame, but the actual collision data for the fixedUpdate trigger seems to be outdated or lagging behind.
Your answer
Follow this Question
Related Questions
How do i get OnTriggerStay2D to work? 1 Answer
Multiple grab locations on 1 game object?,MULTIPLE GRAB LOCATIONS on 1 game object? 0 Answers
Why is there no Rigidbody2D.SweepTest() ? 1 Answer
Handling colliders on hundreds of asteroids (not procedural asteroids) ...URGENT 3 Answers
physics culling mask? 1 Answer