# Collision Detection with Orthographic Camera / in 2D

**URL:** <https://forums.unrealengine.com/t/collision-detection-with-orthographic-camera-in-2d/341846>\
**Category:** Blueprint\
**Tags:** collision-detection, unreal-engine, Blueprint, question\
**Created:** [December 18, 2015, 6:19pm UTC](https://forums.unrealengine.com/t/collision-detection-with-orthographic-camera-in-2d/341846 "2015-12-18T18:19:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Plata\_the\_pilot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Plata\_the\_pilot](https://forums.unrealengine.com/u/Plata_the_pilot)\
**Post date:** [December 18, 2015, 6:19pm UTC](https://forums.unrealengine.com/t/collision-detection-with-orthographic-camera-in-2d/341846/1 "2015-12-18T18:19:06Z")

</div>

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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/c/dec7b89c12abb1c6a382947ab3a45e9438b9cc9d.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [December 18, 2015, 10:10pm UTC](https://forums.unrealengine.com/t/collision-detection-with-orthographic-camera-in-2d/341846/2 "2015-12-18T22:10:40Z")

</div>

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](https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseRaycasts/Blueprints/index.html)

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Plata\_the\_pilot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Plata\_the\_pilot](https://forums.unrealengine.com/u/Plata_the_pilot)\
**Post date:** [December 19, 2015, 1:53pm UTC](https://forums.unrealengine.com/t/collision-detection-with-orthographic-camera-in-2d/341846/3 "2015-12-19T13:53:52Z")

</div>

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.
