I’m creating an FPS and the problem I’m currently having is that the weapon in the hands of my character are penetrating the wall if you get close. I’d like either the hands to back off so that you just see the wall if you come any closer (ideally) or simply to not allow the character to go closer than the end of the gun (I guess this would be easier and it should be enough for a temporary fix). How may I achieve either?
As for the latter, I tried resizing the capsulecomponent of my character but it created a lot problems cause:
a) not all the weapons are the same length
b) I couldn’t figure out how to make the capsule fit tightly and as a consequence you couldn’t walk through narrow doorways
What is the easiest solution to the penetration problem? I thought about attaching a volume to the end of each weapon in their blueprints and then somehow checking if it’s colliding with a wall and if so, blocking the W key. Anything better?