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. Dismiss Notice

Can't find renderer.material

Discussion in 'Scripting' started by Milenchy, Feb 15, 2015.

  1. Milenchy

    Milenchy

    Joined:
    Feb 12, 2014
    Posts:
    19
    I wanted to use it, but as you can see, it's missing:
    Am I doing something wrong ? I am using Unity 5 btw.
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    There is no renderer.material; you need to use GetComponent.

    --Eric
     
  3. Milenchy

    Milenchy

    Joined:
    Feb 12, 2014
    Posts:
    19
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    Those are the Unity 4 docs. When using Unity 5, look at the Unity 5 docs. All the component shortcuts have been removed (except Transform).

    --Eric
     
  5. Milenchy

    Milenchy

    Joined:
    Feb 12, 2014
    Posts:
    19
    Where is the U5 documentation ?
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    On your hard drive, wherever you installed Unity.

    --Eric
     
  7. Sykoo

    Sykoo

    Joined:
    Jul 25, 2014
    Posts:
    1,394
    Is there a list of every shortcut that has been removed? I am at Unity 4.6 currently and I'd like to know if possible! :)
     
  8. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    GameObject isn't a component.

    All of them, except for Transform (think I already said that...). Use GetComponent.

    --Eric
     
  10. Milenchy

    Milenchy

    Joined:
    Feb 12, 2014
    Posts:
    19
    Found it, finally works. Thanks.
     
  11. Sykoo

    Sykoo

    Joined:
    Jul 25, 2014
    Posts:
    1,394
    Holy moly... that's alot deleted, and it sound unneccessary for me ._.
    Is there a specific reason to why they did this?
    Thank you for your reply by the way!
     
  12. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    Read the link that hpjohn posted above.

    --Eric
     
  13. Sykoo

    Sykoo

    Joined:
    Jul 25, 2014
    Posts:
    1,394
    Oh, didn't see it before. Thank you for quick replies!