Hello,
I’d want to have something like “Effector2D” but on a 3D scene. I have an object under my Terrain and with an “AddForce” I would like this object to be fired out of the ground and then fall back on the ground (terrain). So I’d need a kind of “One way” collision with this object and the ground …
Do you expect the object to collide with anything else during its flight path? How predictable is the flight path? Is it always going to have at least a certain amount of hang time?
One option is make its collider start as a trigger collider, then when you detect OnTriggerExit with the ground, you can convert the trigger collider into a non-trigger collider.
Another option is disable the collider until the vertical velocity becomes negative (could be problematic if your terrain has overhangs or if you expect the object to collide with other things.
Another option is Physics.IgnoreCollision specifically with the ground until some criteria is met (negative y velocity, some amount of time passed, trigger exit with some smaller ground trigger you place around the object itself.
There’s a lot of options here. I think you’ll have to use at least one of the following in some way:
Physics.IgnoreCollision
Layer-Based collision (either changing layers of the objects at some point or using Physics.ignoreCollision with certain layers at certain points)
Disabling/enabling/creating a collider at some point
Changing a collider from trigger to non-trigger at some point.