Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Objects not Casting Shadows Correctly

Discussion in 'General Graphics' started by RPKMN1, Oct 11, 2020.

  1. RPKMN1

    RPKMN1

    Joined:
    Feb 13, 2017
    Posts:
    34
    I am working on an in-world UI element to draw circles around the feet of selected characters a la Baldur's Gate. I needed them to always draw on top of the ground, so I did the technique of putting them on a separate layer and having them be rendered by a different camera and then using a culling mask and camera depth to force it to render the circles on top of the ground.

    Of course, the next problem I had was that my circles were being drawn on top of my characters and not just on top of the ground. So, I moved my characters to be rendered by the same camera that was rendering my circles and the problem went away.

    But now I have a different problem. My characters are no longer casting shadows on the ground. I presume because the ground and the characters are being render by different cameras?

    Am I going about this the right way? the only problem I have right now is that none of my character models cast shadows on the ground anymore. If I can fix that, I'm good to go.
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,996
  3. RPKMN1

    RPKMN1

    Joined:
    Feb 13, 2017
    Posts:
    34
    I actually am using a regular mesh for the circle, but I also have a line renderer that I am doing the same thing with to show an expected path.