FPS Game: How to hide player model but still have shadows

I’m trying to make a simple FPS and having a little trouble with aesthetics. I have a Player GameObject that contains a Camera and a Model. When I play, the model casts a shadow on the ground, and I can also see the model from my camera. I want to hide the model but I still want the shadow on the ground. How would I do that?

I tried a few things that I thought would work, but haven’t had any luck yet.

  • I tried setting the model to a new layer and instructing the camera to cull the layer the model is on, but the shadows disappear. I even made sure the light isn’t culling the new layer. I thought this would work… (I can see the model and shadow in the Editor window, but my camera ignores both)
  • I then tried to write script that would hide the model on PreRender and show on PostRender, hoping the lighting effect would happen, but it didn’t…

My next idea is to write a shader that renders the model invisible-like, but I think I’m over thinking it. What is the general approach to achieve this effect in Unity?

Google is pretty awesome, eh? XD This answer should answer your question.