Question by
Miguel7u7 · Aug 17, 2019 at 08:30 AM ·
programmingshadows
Is there a way to make some kind of "dynamic" shadow?
Hi, so I'm working on a small game right now which is very similar to this
I was wondering if there is a way to make a shadow work like in that example so it could change its size depending on the distance of the object, if it's closer to the ground the shadow gets bigger and biceversa. So is there a way this can be worked around with the unity shadow system? or is there any other way this could be done?
Thanks in advantage for the help (:
Comment
Best Answer
Answer by UltraGearGames · Aug 17, 2019 at 10:13 AM
You can probably either use a raycast, or Vector3.Distance to measure the distance to the floor, and depending on the distance you can scale a shadow texture plane, which you will lock the Y axis of, so it stays on the floor.
Your answer
![](https://koobas.hobune.stream/wayback/20220612210750im_/https://answers.unity.com/themes/thub/images/avi.jpg)