Line Trace and Sphere Collision

Hi!

I have a Actor blueprint wich contains a static mesh component and sphere collision attached to it. I want to sphere collision triggers a overlap events, and static mesh component for Line Trace For Object events, but I can’t get this working, Line Trace hit result always show the sphere collision component, and not a Static Mesh Component, only when I disable the sphere collision the setup works. Any Ideas how to resolve this?

1 Like

I just did this and it works out of the box.

The collision volume is set to ‘overlap all dynamic’ and the mesh is block all.

EDIT: I’m just checking, obviously you can’t trace through the cube to the sphere ( if it’s on the inside ).

I’ve found the solution, just need to create custom channel for object in project settings, and in Line Trace For Object change to use the new channel.

2 Likes

Thank you very much, this has got me unstuck from a similar situation. I also had to figure out that once I create custom object channel in under Project Settings → Collision (with Ignore by default), I needed to go to the traced object’s Collision settings, select custom preset and in the list select Block for my new object channel. Then I could use the LineTraceByChannel function to only trace objects with my object channel set to Block.

This article is a good resource for general collision and line tracing understanding: Collision Filtering - Unreal Engine