Search Unity

[SOLVED] Disable shadows per GameObject

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

  1. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    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
     
    GhulamJewel likes this.
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    836
    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:
    1,084
    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:
    103
    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
     
    jokerbroker likes this.
  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
     
    jokerbroker likes this.