# Why is my raycast hitting the capsule component and not the skeletal mesh?

**URL:** <https://forums.unrealengine.com/t/why-is-my-raycast-hitting-the-capsule-component-and-not-the-skeletal-mesh/599759>\
**Category:** C++\
**Tags:** Raycast, unreal-engine, UE4, question\
**Created:** [July 8, 2022, 3:31am UTC](https://forums.unrealengine.com/t/why-is-my-raycast-hitting-the-capsule-component-and-not-the-skeletal-mesh/599759 "2022-07-08T03:31:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShadowSprite123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ShadowSprite123](https://forums.unrealengine.com/u/ShadowSprite123)\
**Post date:** [July 8, 2022, 3:31am UTC](https://forums.unrealengine.com/t/why-is-my-raycast-hitting-the-capsule-component-and-not-the-skeletal-mesh/599759/1 "2022-07-08T03:31:52Z")

</div>

Any ideas on why my raycast is hitting the capsule component and not the skeletal mesh of the enemy even though I have trace complex set to true?

---

<div class="post-metadata">

**Author:** ![Quetzalcodename](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Quetzalcodename](https://forums.unrealengine.com/u/Quetzalcodename)\
**Post date:** [July 8, 2022, 10:12am UTC](https://forums.unrealengine.com/t/why-is-my-raycast-hitting-the-capsule-component-and-not-the-skeletal-mesh/599759/2 "2022-07-08T10:12:42Z")

</div>

Hey @ShadowSprite123!

A few questions:

- Would you mind sharing the code snippet for your raycast? It would go a long way in understanding what you are doing/what may be going wrong.
- Are you looking specifically for a skeletal mesh component? Your raycast would hit the outermost shell of a target which would be the capsule component, so looking specifically for the skeletal mesh may fix that.

Any additional information you can provide will be a big help in solving your problem.

---

<div class="post-metadata">

**Author:** ![ShadowSprite123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ShadowSprite123](https://forums.unrealengine.com/u/ShadowSprite123)\
**Post date:** [July 9, 2022, 12:27am UTC](https://forums.unrealengine.com/t/why-is-my-raycast-hitting-the-capsule-component-and-not-the-skeletal-mesh/599759/3 "2022-07-09T00:27:30Z")

</div>

Don’t worry I fixed it! The problem was that I was using Use Complex Collision as Simple instead of Use Simple Collision as Complex in the physics asset.
