Prevent line trace from hitting capsule

Hello everyone, I could need some help for setting up player’s capsule. When I shoot, the line trace hits my capsule and the only way I found to prevent this is to move forward the camera but this causes clipping into the walls. How can I fix that? Thanks in advance :slight_smile:

Can you show a screen capture of the line trace node you are using?

I don’t know what kind of line trace you’re doing, but there are some things you could try:

LineTraceByChannel set to visibility should be excluding the capsule by default, since it’s not a visible component.
Ignore self should exclude all the components of the player character as well.
But maybe you’re not running the script in the player character BP…

There are further details needed to pin point the problem.

i’m using this node Imgur: The magic of the Internet

you could try to make an array for the ‘actors to ignore’ and add a reference to self.
If that doesn’t work I guess you could do a multi line trace and get the first hit that isn’t your capsule.

probably should do a print string to print out the hit component to confirm whether it’s hitting the gun mesh or capsule or what.

Thank you, I’ve created an array which I’ve then casted to the firstpersoncharacter and used “get player character” as object and that worked.