How to make gameobject invisible but still cast shadows without mesh renderer?

I’m very new to unity.

How to make gameobject invisible but still cast shadows without Mesh Renderer?

My model doesn’t have a Mesh Renderer, which is the only way I can think about doing this. When I add a Mesh Renderer, it does nothing.

It needs a Mesh Renderer to cast shadows.

Solution

Add the Mesh Renderer back, and set the alpha on the material to 0. And make sure that Cast Shadows ☑ is ticked. And for the surface that is receiving shadows, make sure to enable Can Receive Shadows ☑ (both in the Inspector).

This was resolved in the latest Unity-2022-3-LTS release to the date of this comment.

Under the mesh renderer component Select Cast Shadows Shadows Only.