Collision Detection with Orthographic Camera / in 2D

Is it possible to detect a collision in 2D only?

For example: If there are two boxes with the same coordinates in X and Z but different in Y, they will not collide. However, it looks like they should collide if an orthographic camera projects them to a 2D plane.

Any ideas how I can detect such a “collision” in blueprints? Do I have to actually move all objects to the same Y coordinate first?

71183-2d+collision.png

Hello ,

To use the built-in collision system, they will need to actually collide. This means that you would need to set them both to the same Y coordinate. If you need to avoid this however and don’t mind getting more complicated, I would suggest looking into raycasts, in both line and shape form. You could have them be the detection for you by using a limited distance and using the Hit that is returned to do any logic you need as a result.

Documentation:

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseRaycasts/Blueprints/index.html

Hope this helps!

Thanks! I do a box trace from the camera plane with the size of the blue box until I reach the Ortho Far Clip Plane distance.
The only issue I have is that this also detects the floor. With a MultiBoxTrace, I also get the black box. Not quite sure how to handle this. Maybe I have to count if the number of objects hit by the trace changed.

EDIT: Seems to work when I check for initial overlap. Now I need to find a good way to block movement like the built-in collision system would.