First Person Local Shadows

Hello fellow Developers!

I’ve been working on a first person game recently and noticed there was a distinct lack of character shadows!

After a bit of experimentation I found a way of casting such shadows, although it does take a hit to performance, so please, feel free to experiment with this or improve it!

You can get it here!
LocalFirstPersonShadows - Roblox

Requirements:

  • Place the script in StarterCharacterScripts
  • Place a light in a part/attachment in workspace with Shadows enabled

How it works;

  1. Define all local (point, spot, surface, etc) light sources in the world (will account for lights in attachments)
  2. Create a stripped down clone of your character
  3. Scan through lights
  4. If within range, and not looking at - create a clone (doesn’t account for light Radius!)
  5. Scale clone and position in front of light source
  6. Delete clone for said light source if 4. isn’t met.

Limitations

  • Performance is not great - use for experimental / showcase work!
  • Sometimes the limbs of the shadow appear disconnected
  • Doesn’t cast sun shadows! (You can use @Maximum_ADHD’s First Person Shadows for this)

Static Lights

Non-Static Lights

40 Likes

This is definitely the best resource that I have seen throughout my life on devforum.
a very good job you did.

3 Likes

This seems useful for games that are going for a good environment, like horror games or adventure games. Probably not a good idea to insert that into a combat game though.

2 Likes

I think it’s very impressive you managed to get no peter-panning in the spotlight shadows here, good job

1 Like

This is for sure the best resource and I will be learning so much from this. Thank you!

1 Like

I actually think this can be used on stages(singing stages), or many other adventure games!
I really think this can be one big step on being a successful developer.

1 Like