Keep object from going through the floor


#1

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:


#2

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.


#3

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


#4

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


#5

i have tried that still didnt work


#6

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