I’m trying to stop my weapon collision boolean from rapidly toggling when complex geometry makes my line trace jitter.

hi, im trying to figure out how to avoid this boolean value changing it’s value constantly. what i have here is a line trace coming from my weapon to detect a wall. if it gets something, that bool makes the character move the weapon away. what my issue is that when encountering more complex geometry, the line trace gets messed up and jitters alot causing inconsistencies in the bool value. any help?

try a sphere trace

it doesnt really work, the result being almost similar

cant really show videos here because im a new user and it doesnt let me