Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

2d platform - shadow of character when he is at the edge

Discussion in '2D' started by cybergamedeveloper, Feb 20, 2021.

  1. cybergamedeveloper

    cybergamedeveloper

    Joined:
    Aug 10, 2020
    Posts:
    3
    I have a character in 2D platform.
    The shadow is an eclipse that rendered at the bottom and on top of the floor/platform where he stands on.
    However, when moves to the edge of the platform, the shadow sprite is fully rendered.

    i want to render only the partial of the shadow sprite and it should be cut off at the edge.
    Any suggestion will be appreciated.

    I was thinking about keeping raycasting down at both ends of the shadow and crop the size of the shadow sprite based on the hit results. However will this be overkill if there are many objects at the scene?
     
unityunity