Setup Steps:
-
Download the files
-
baz_drop_shadow.gd(script)baz_drop_shadow.gd (4.7 KB)
-
shadow.png(texture, you can use your own)
-
-
Add files to your project
- Place both files in your Godot project folder (e.g.,
res://)
- Place both files in your Godot project folder (e.g.,
-
Create the shadow node
-
Select your player/character node
-
Add a BazDropShadow child node
-
-
Configure the node
-
Assign
shadow.pngto the Texture property -
Set initial Scale (this becomes the shadow’s base size)
-
-
Set the collision mask
Important!-
In the inspector under Raycast → Collision Mask (common mistake is the Raycast will hit the player collision, so make sure they are different then the ground tile collision)
-
Enable ONLY the layer(s) your ground/platforms use
-
Make sure the player’s layer is NOT enabled (or the shadow will stick to the player)
-
-
Adjust settings to taste
-
Tile Size: Match your game’s tile size for proper scale decay
-
Ray Offset: Distance between the two detection rays
-
Min Shadow Scale/Alpha: How small/faded the shadow gets at max distance
-