How to make transparent object have shadow in 3d environment?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By freakcoco

I want to make a living shadow in 3d environment (godot 3.1).
A characters which shadow is made by another object(3d model)!
The object is transparent that players cannot see that!
I see there have way to toggle off shadow!
But I don’t know how to make shadow in transparent object.

:bust_in_silhouette: Reply From: Dlean Jeans

This will hide the mesh and ony render the shadow:

  1. Click on the MeshInstance
  2. Go to the Geometry tab
  3. Change Cast Shadow property to Shadows Only

It doesn’t seems to work.
I have a mesh instance using as a floor on which shadow drops from some cube.
When I change to: cast shadow → shadows only, the mesh disappears as well as the shadow that was dropped on it.

bashan | 2020-02-23 22:48

bashan: To solve this, you can duplicate the mesh and render it with separate materials: One mesh with an opaque material that casts shadows only, and one with a transparent materials that is rendered normally.

Calinou | 2021-05-05 18:09