How to prevent hitscan guns linetrace from hitting the minimap volume trigger?

Several of my guns use line trace. When I shoot these guns, the line trace hits the Minimap Volume Trigger, which detects the player and NPCs in the world. I am using LinetraceForObjects. If I remove the minimap, everything works fine. How do I prevent the line trace from hitting the minimap or the Minimap volume trigger? I know I have to setup a custom collision channel, but I don’t know the process of doing it. Please help me with a clear explanation.

If the minimap volume inherits from unreal’s base AVolume class then you could try selecting the minimap volume => going into it’s collision component and setting the trace segment to ignore. If the minimap has a custom trace channel then you need your weapons to ignore that specific channel on trace.

In the worse case scenario you can create a custom trace channel and trace the weapons only against this newly created channel.

The Minimap is of the Actor class type. The volume trigger is a child of the BP_minimap.
image


This is the collision setup for the overlap trigger.

This is the gun line trace. Though I set up actors to ignore it does not work.

You can see the collision of the gun line trace in the top left corner. Can you please help me set this up? I don’t understand how to setup the Collision channel, etc.

Looking at the trace I noticed you are tracing by object and not trace channel so you need an object channel

The Minimap volume Trigger is also constantly checking the Player and NPCs positions to update on the minimap. This method won’t disrupt that?

It shouldn’t. You are only changing the category in how the minimap is identified for object traces and as you don’t plan on reporting line traces on it, it should be safe.

I tried your method and then the linetrace did not detect the collision box but detected everything else in the world but the Minimap disappeared! I changed the linetrace method to LineTraceByChannel


with the settings like this and now everything works fine Minimap and all! Thank you very much for your valuable time for helping another person. It’s people like you that make the world a good place. May you be well!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.