I wanted to try making a 2D platformer where you walk on the shadows cast by the 3D world around you

I am really noob , how can i do?

This is kinda Advanced, it’s not an easy question…

As far as I know, you can’t see if an object is lit or not, you need to do it in “alternative ways”, like raycast or collision spheres around lights.

Can you provide a visual example of what you mean?

1 Like

and i want to use keyboard input to change 2d control and 3d control.

Will this problem be easier if I use fake shadows? (Use plane as a shadow)

Thanks!

Cool idea. Yes, way easier if you model the fake shadows if you’re currently at “really noob” level. Instead of planes you could place invisible geometry for the player to jump/climb on in front of the shadows.

2 Likes

If I understand your concept, it’s a very novel and interesting one with some really interesting game-play possibilities (e.g. positioning yourself in a 3D world to make your shadow able to perform acrobatic moves on shadows in a 2D world). How to go about this though…

Unreal has no built-in shadow detection, so any kind of stealth game needs to do a lot of traces from (nearby) light sources to the player. They usually cheat a little by tracing to specific points (head, body, hands, feet). There’s no way to a get a full-mesh trace for shadows that I know of in any non-custom build. To see where a shadow falls, you extrapolate the trace until it hits something.

For your purposes, traces would work too. I guess from the light source(s) to the base of the player’s feet, then extrapolated to the 2D plane. Also, from the light source(s) to the top of the geometry, again extrapolated to the 2D plane. All you need to know is, “Are my character’s feet’s shadows on the top of a geometry shadow?”.

It’s tricky, and I wouldn’t want to do it!

1 Like