How To Prevent Guns From Collides Against Walls

So I’ve made a full-body survival game, and one error that might require repairs would be this…The guns collide against the walls and I just wondering how to make the player do a certain animation where it holds the gun vertically when it collides against a wall. I’m sure you’ve seen this in third-person games.

Ray—and-------play animation flipper mode(lift weapon)

Ray(invert) - - - - - - and - - - - - fire weapon and remove 1 ammo
Fire button------------/
Ammo not zero—/

cast a ray with true pulse in forwards direction, set it at a range you like, then play animation when ray is positive.

the animation you need is just one that animates the arms down or up.

edit you use collision on weapon? then simply use collision sensor instead of ray, and do this way or BPR’s way

I’m guessing that the first line is to play the animation. Not sure what the other ones are for…

The lines on the bottom are fire weapon, if you have ammo, and your not lifting up the weapon and you press shoot.

So i’ve done what you instructed in the first line, but everytime I hit a wall…it just replays the animation. Then it also just plays the animation everytime I’m not colliding with a wall.

Okay, I found a way. It’s like 75% efficient. So I might conclude this as solved…

2 other options:
In the materials tab increase the offset to -10000, or make the weapon so small that it fits within the player collision bounds

Oh, well I already found a alternative that works for my player. Since your tips are intended for first-person games. My player is a full body player. Well thanks for trying to help, despite the fact this problem has been solved.