How to add shadow to platformer 2D?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Sprowk
:warning: Old Version Published before Godot 3 was released.

I have rigidbody2d moving on collisionpolygon2d terrain. What I want to achieve is to have shadow always under character visible on the terrain.
( Also I have no experience with light or things like this. )

Can you give an example of how is the shadow effect you want to achieve? (a row of darkness, a spot somewhere)

eons | 2017-12-03 15:22

Spot underneath character. directly on closest ground.

Sprowk | 2017-12-03 22:16

:bust_in_silhouette: Reply From: rustyStriker

You can simply add a black(ish) circle underneath your character, as the light comes from above, and there is a little circle of shadow underneath his legs… or in another way where you simply add the shadow as a sprite rather than modifying the terrain itself, sort of passing the need for a lighting system.

Good idea but how about changing height or multiple surfaces on top of each other? Better question how can I check how far is character above ground?

Sprowk | 2017-12-03 22:08

Have you ever solved this?

p7f | 2018-12-19 14:10