Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Perlin Noise Scripting Example

Discussion in 'Scripting' started by netside, Dec 18, 2014.

  1. netside

    netside

    Joined:
    Nov 3, 2014
    Posts:
    9
    I was trying to use the example script from the Unity Scripting Guide here: http://docs.unity3d.com/ScriptReference/Mathf.PerlinNoise.html

    No matter what I seem to attach the script to, it gives me the error saying no renderer object is present:

    "MissingComponentException: There is no 'Renderer' attached to the "Light1" game object, but a script is trying to access it.
    You probably need to add a Renderer to the game object "Light1". Or your script needs to check if the component is attached before using it."

    What am I doing wrong?

    Thanks..
     
  2. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    At a guess I'd say you have put this script onto a light called "Light1", and "Light1" has no renderer attached.
    The script has the line renderer.material.mainTexture = noiseTex, so there needs to be a renderer for it do do that