I am using a single linetrace by channel and have set up a custom trace channel that is set to block. As you can see in the video the linetrace goes through and sometimes randomly passes through. Can anyone help me understand why this might be happening. Thanks
Hey there @Jag-yt! Welcome to the community! That’s definitely interesting! I’ve never seen stationary trace inconsistencies like that. Does this issue only affect your custom trace channels? What version of the engine are you using?
I encountered a similar issue before, try adding a collision box to your cube that’s slightly bigger than it’s actual size. This issue never happens on imported meshes (in my case it was Blender) no matter the shape and I guess it’s because their collision volumes already exceed their bounds.
Fixed: So the issue was with the calculation of the linetrace. I was doing an initial raycast till infinity to find out if there was an object in front of the barrel. I was storing the hit location and then I was doing another lintrace till that point(as seen in the video). The reason I was not getting any hit was because of this logic, the line trace would end right before the object. Instead of doing this, I am now calculating the normalized direction vector to the hit location and multiplying that with a huge number like 100000 and setting that as the end point for the line trace. That works just fine!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.