Update 2D sprite at runtime from scene capture // turn shadows into collisions

Hello!

I’m working on a gameplay feature where shadows, projected by a light that you control, would act as colliders for the character in a third person platformer context. So basically you could “move” the shadows to adapt the level design.

So far I’ve came up with the idea of capturing the scene (maybe the lightpass for instance) within a render target, that’d be fed into a sprite at runtime to generate a “shrink wrapped” collision, extruded to a large amount.
The issue is sprites don’t take render target as input. They can take static textures, but it seems those can only be written in editor.

So is it possible to somehow input a scene capture in a sprite, and update its collision at runtime ?
It would also mean updating the collision at each frame, wich could get bad for perf I guess.

Or if someone has a complete other approach for turning projected shadows into collisions, I’d look into it as well :slight_smile:

Thanks !