Keep object from going through the floor


Ok so i am bored and made this little thing (game) but i cant seem to keep the gun from going through the floor when you look down:

I just cant seem to prevent the weapon from going through the walls and floors :frowning:


Normally, the way to do this is to render the gun last (on a separate layer) and have the gun materials not test or write to the Z buffer. That way, it will render on top of everything that has already been rendered to the buffer.


how do i do that? im not quite understanding that part…


you might wanna try a collision depending on the rigidbody check if it’s static or dynamic that probably could help


i have tried that still didnt work


hmm probably has something to do an collision on a certain or object or with where the gun is located in the root