How can I handle this

Heres what I have so far which I’m scrapping as it contains some issues that I cant see being easily resolved as well as its a bit overly done. My idea to replace this is with some physics. My idea was to have a physics constraint component attached to the stock of the firearm, then have a separate actor spawn thats just a collision sphere at the muzzle and get attached to that physics constraint. I want it to follow the muzzle when moving (which it should by default I think due to how its attached?) but when I walk into a wall or something I want it to move the sphere around as its being blocked by the wall so I can orient my firearm to rotate and face that collision sphere to simulate the firearm having collision. I already have an IK setup in place for everything so it shouldnt be to hard once I figure it out to set it up. I tried it with physic constraints but they do not seem to want to work right at all with what Im trying to do so I’m not sure if I should go a different route.

I am now attempting to make a system similar to this