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

How to disable Mesh Render Shadow on specific object?

Discussion in 'Scripting' started by Wister1230, Jul 1, 2015.

  1. Wister1230

    Wister1230

    Joined:
    Jun 6, 2015
    Posts:
    50
    Hello,
    How to disable Mesh Render Shadow on specific object? (Using a code of curse)
    Thanks all for help!
     
    emelyanovm2 likes this.
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
  3. Wister1230

    Wister1230

    Joined:
    Jun 6, 2015
    Posts:
    50
  4. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    ah, you need to include
    Code (csharp):
    1.  
    2. using UnityEngine.Rendering;
    3.  
    at the top of the script, or use
    Code (csharp):
    1.  
    2.  ... = UnityEngine.Rendering.ShadowCastingMode.Off;
    3.  
     
    SNTdev likes this.
  5. Wister1230

    Wister1230

    Joined:
    Jun 6, 2015
    Posts:
    50
    It Works, Big thanks bro!
     
  6. Wister1230

    Wister1230

    Joined:
    Jun 6, 2015
    Posts:
    50
    Can you help me bro with another thing?
    How to make the GameObject able to move in distance from 0 till 3?
    Code (CSharp):
    1. Vector3 MousePosition = new Vector3(Input.mousePosition.x, Input.mousePosition.y, Distance);
    Thanks for help!
     
  7. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    I not too sure what you mean, but if you mean "change distance over time from 0 to 3" you're probably looking at a Lerp function.

    also conventionally variables are lowercase first letter, Classes and Functions are uppercase first letter :)
     
  8. Wister1230

    Wister1230

    Joined:
    Jun 6, 2015
    Posts:
    50
    Can you give me an example fo a Lerp Function please?
     
  9. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    going to pass that one off to google; Lerp is something of a sticking point for newbies and there are loads of examples and how to's on it.
     
  10. Wister1230

    Wister1230

    Joined:
    Jun 6, 2015
    Posts:
    50
    Have you got skype bro?