# Collision Detection

**URL:** <https://forums.unrealengine.com/t/collision-detection/793649>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, Physics, Collision, bug-report, editor, Blueprint, CPP, question\
**Created:** [March 18, 2023, 2:15pm UTC](https://forums.unrealengine.com/t/collision-detection/793649 "2023-03-18T14:15:28Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adeel\_Yaqoob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/adeel_yaqoob/32/616028_2.png) [@Adeel\_Yaqoob](https://forums.unrealengine.com/u/Adeel_Yaqoob)\
**Post date:** [March 18, 2023, 2:15pm UTC](https://forums.unrealengine.com/t/collision-detection/793649/1 "2023-03-18T14:15:28Z")

</div>

I have physical bullets in my game and not a line trace system. The bullets skip the collision while still hitting the enmey and pass through it. When I set bullet velocity to less, the collision is perfect. What is the reason? I want to keep bullet speed high while keeping perfect collision checks. Please let me know the issue. Thanks

---

<div class="post-metadata">

**Author:** ![EvilCleric](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvilCleric](https://forums.unrealengine.com/u/EvilCleric)\
**Post date:** [March 18, 2023, 5:02pm UTC](https://forums.unrealengine.com/t/collision-detection/793649/2 "2023-03-18T17:02:45Z")

</div>

Have you tried CCD?

 ![img009](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/c/fcc484a8c16448ee1f728812401e6666ee997e8f.jpeg)

---

<div class="post-metadata">

**Author:** ![Adeel\_Yaqoob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/adeel_yaqoob/32/616028_2.png) [@Adeel\_Yaqoob](https://forums.unrealengine.com/u/Adeel_Yaqoob)\
**Post date:** [March 18, 2023, 8:05pm UTC](https://forums.unrealengine.com/t/collision-detection/793649/3 "2023-03-18T20:05:19Z")

</div>

No, I haven’t. By the way what is this CCD?

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [March 18, 2023, 8:48pm UTC](https://forums.unrealengine.com/t/collision-detection/793649/4 "2023-03-18T20:48:55Z")

</div>

Hey there @Adeel_Yaqoob! CCD is Continuous\* Collision Detection. It basically increases accuracy/rate of collisions. However with extremely high speed objects, you may need to stretch them length wise. Another alternative is tracing where it was to where it was last frame and if you get any hits just count that as a connection, however both of these methods have their drawbacks.

---

<div class="post-metadata">

**Author:** ![Adeel\_Yaqoob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/adeel_yaqoob/32/616028_2.png) [@Adeel\_Yaqoob](https://forums.unrealengine.com/u/Adeel_Yaqoob)\
**Post date:** [March 18, 2023, 8:53pm UTC](https://forums.unrealengine.com/t/collision-detection/793649/5 "2023-03-18T20:53:20Z")

</div>

@SupportiveEntity Thank you so much \<3

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [March 18, 2023, 8:56pm UTC](https://forums.unrealengine.com/t/collision-detection/793649/6 "2023-03-18T20:56:06Z")

</div>

No problem! I forgot to mention, if none of these (and a combination of which) don’t work for you, you may just be moving your bullets too fast. Often-times when bullets need to go so fast they are lasers, it’s often better to swap to traces and fake the physical bullets. Many games do this, and a good example of it is done in Lyra if you’d like to see it in action.

---

<div class="post-metadata">

**Author:** ![Adeel\_Yaqoob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/adeel_yaqoob/32/616028_2.png) [@Adeel\_Yaqoob](https://forums.unrealengine.com/u/Adeel_Yaqoob)\
**Post date:** [March 19, 2023, 12:49pm UTC](https://forums.unrealengine.com/t/collision-detection/793649/7 "2023-03-19T12:49:21Z")

</div>

@SupportiveEntity Wow, Amazing \<3

---

<div class="post-metadata">

**Author:** ![Adeel\_Yaqoob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/adeel_yaqoob/32/616028_2.png) [@Adeel\_Yaqoob](https://forums.unrealengine.com/u/Adeel_Yaqoob)\
**Post date:** [March 23, 2023, 9:28pm UTC](https://forums.unrealengine.com/t/collision-detection/793649/8 "2023-03-23T21:28:30Z")

</div>

@SupportiveEntity Does the other actor also has to have CCD checked?

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [March 24, 2023, 1:13am UTC](https://forums.unrealengine.com/t/collision-detection/793649/9 "2023-03-24T01:13:56Z")

</div>

Since the bullet is the fast moving object, only it requires it. Evaluating the bullet position matters more than the other object unless the other object is also moving quickly.

That said if the bullet is too fast, you may need to combine a couple of the other options. Movement and framerate are tied so if frames are lower you’ll also see more misses that way.

---

<div class="post-metadata">

**Author:** ![Adeel\_Yaqoob](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/adeel_yaqoob/32/616028_2.png) [@Adeel\_Yaqoob](https://forums.unrealengine.com/u/Adeel_Yaqoob)\
**Post date:** [March 24, 2023, 1:18am UTC](https://forums.unrealengine.com/t/collision-detection/793649/10 "2023-03-24T01:18:14Z")

</div>

Understood

---

<div class="post-metadata">

**Author:** ![GRE\_Alexander](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GRE\_Alexander](https://forums.unrealengine.com/u/GRE_Alexander)\
**Post date:** [January 23, 2024, 4:19pm UTC](https://forums.unrealengine.com/t/collision-detection/793649/11 "2024-01-23T16:19:20Z")

</div>

Hey SupportiveEntity, not OP but I am also having some issues with very fast melee attacks not registering hits.  
I’m very interested in the solutions you provided and I was wondering if you have any resources to point me towards that explain how I would go about achieving the things you mentioned (stretching the length time wise, checking between frames, etc).  
Or maybe if you could explain briefly either in c++ or pseudocode. Do I use tick and deltatime to achieve these things?  
Any help or guidance would be appreciated.

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [January 27, 2024, 10:14pm UTC](https://forums.unrealengine.com/t/collision-detection/793649/12 "2024-01-27T22:14:27Z")

</div>

Hey there @GRE_Alexander! So depending on how you’re handling your collision there’s tons of ways to go about it. If you’re tracing during animation with animation notifies, you’d just poll every frame tick and widen the trace. However if you are using collision volumes, you’re turn on CCD in the collision’s settings and widen the collision as well. Alternate means can get a bit more programmatic.

---

<div class="post-metadata">

**Author:** ![GRE\_Alexander](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GRE\_Alexander](https://forums.unrealengine.com/u/GRE_Alexander)\
**Post date:** [January 28, 2024, 6:54am UTC](https://forums.unrealengine.com/t/collision-detection/793649/13 "2024-01-28T06:54:24Z")

</div>

Hey SupportiveEntity, thanks for the reply.  
Yes, I am using anim notifies to enable/disable tracing. Unfortunately, simply widening the trace isn’t much of a solution I can use, since I am trying to get a bit more precision with my traces/checks.  
You mentioned there may be more programmatic solutions so I am wondering if you can send any resources my way or if you are aware of any talk/book/paper (or anything really) that explains how precise collision detection works in games.

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [January 29, 2024, 1:06am UTC](https://forums.unrealengine.com/t/collision-detection/793649/14 "2024-01-29T01:06:01Z")

</div>

I don’t have any scholarly resources on hand, but the general method used would be to trace from where a checkpoint/socket/bone on a weapon was in one frame and trace it to where it is now, and should work down to even lower framerates losing comparatively less accuracy. This can be done perpendicular or parallel.

(Image from Marketplace plugin: [Impact Melee Trace](https://www.unrealengine.com/marketplace/en-US/product/impact-melee-tracing#) from Darkmodegamedev)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/7/787e32200bb7a0a71a0e6aab325625c313e10f2b.jpeg)

In this older thread users go a bit into detail with some similar systems:

> [@How to make collision detection for fast melee combat?](https://forums.unrealengine.com/t/how-to-make-collision-detection-for-fast-melee-combat/23531):
>
> Hi! I think fast melee combat at low FPS is a known issue, so I’m planning ahead and hope to have it solved when the time comes to actually implement it. I figured that i can use sockets attached to the skeleton to read the position of the tip and base of the weapon. Tho, during low FPS situations they can move quite a bit, especially for long staffs! A potential solution to this would be to check the distance between current (0) and previous (-1) frame and then construct the poses for in-be…

---

<div class="post-metadata">

**Author:** ![GRE\_Alexander](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GRE\_Alexander](https://forums.unrealengine.com/u/GRE_Alexander)\
**Post date:** [February 1, 2024, 3:58pm UTC](https://forums.unrealengine.com/t/collision-detection/793649/15 "2024-02-01T15:58:57Z")

</div>

I see, thank you for taking the time to reply. Much appreciated!  
I will do a bit more research on the topic and look into that plugin.
