Not sure what exactly you want, multiple ways to go about the issue.
games like PUBG disable aiming when up close and position the camera closer to the gun to decrease the offset.
Some other games let the player know by adjusting the crosshair, and use the original method of aiming from the character.
This is up to your game and is also in part a game design question rather than a scripting support question.