Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice

[SOLVED] Disable shadows per GameObject

Discussion in 'General Graphics' started by Shushustorm, Mar 28, 2015.

  1. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    978
    Hello everyone!
    Do you know whether there a way to disable shadows from certain sources?
    For example, in a project I am currently working on, I would like the terrain (custom-made, not a Unity terrain) to only recieve shadows from the main character and not by other sources, including itself.
    Is that possible?
    If possible, I would prefer a way that doesn’t involve any scripting because I’d like to see the result in the editor, too.

    Many thanks in advance,
    Greetings,
    Shu
     
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    819
    In the Mesh Renderer component you can select if that object will cast and receive shadows. So if there are some objects that you don't want to have a shadow, just disable shadow casting in their Mesh Renderer component. More info here http://docs.unity3d.com/Manual/class-MeshRenderer.html
     
  3. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    978
    Thank you very much! This is exactly what I was looking for!
     
  4. mayfas

    mayfas

    Joined:
    Dec 9, 2018
    Posts:
    2
    thanks
     
  5. McPeppergames

    McPeppergames

    Joined:
    Feb 15, 2019
    Posts:
    80
    But what about when this option is not showing up in the mesh renderer, like for example in the Warrior Character New Input System sample project where the Warrior mesh doesn't have this option?
     
  6. TheAnimatedKiddo

    TheAnimatedKiddo

    Joined:
    Aug 20, 2020
    Posts:
    2
    You can add it.
     
  7. warman88

    warman88

    Joined:
    Dec 27, 2020
    Posts:
    6
    that didnt work for me i added a mesh renderer on something i imported and i turned of the shadows but there are still shadows
     
  8. warman88

    warman88

    Joined:
    Dec 27, 2020
    Posts:
    6
    i found the mesh renderer after digging deeper into my thing i imported and it wont let me edit the mesh renderer
     
unityunity