Gun barrel elevating due to a tree,fence,bench or any other obstacle in the way?

Im pretty sure you got killed atleast once because your barrel decided to go up just because you
aimed at the fence,tree or something else from the third person. Is it possible to make those unnecessary kind of ‘‘see through’’ so they don’t interact with aiming? It is very annoying. Do you agree?