@kyra only problem with the depth test thing is what if you have something that has more than one mesh? Then the viewmodel itself gets all funky
@duskdev best answer I got for you is "it sure does man" (this is a joke I know it sucks).
As a game developer who has never created a product anyone has played, my favourite way to do an FPS gun is to make it an object in the world. (This is also a joke, because it's an accurate description of what I'm like)
@duskdev yeah i think your best bet is a subviewport+extra camera+render layer 2 viewmodel and lights that run set_layer_mask_value(2,true) on themselves in the ready function
@duskdev in terms of lighting; the different render layer+subviewport method. Unfortunately I think you might wanna use an extended light which sets itself to be on render layer 1 and also 2 or wherever you keep your viewmodel