Search Unity

More errors I dont understand.

Discussion in 'Scripting' started by Apple_Sauce11, Oct 10, 2015.

  1. Apple_Sauce11

    Apple_Sauce11

    Joined:
    Oct 10, 2015
    Posts:
    12
    I have almost no knowledge and I have no skill in scripting/coding.

    I was setting up a re-spawn system and to start it off I was making sure it worked by using a debug test. If only the script worked. I have an error which says:

    Assets/Scripts/BallHealth.js(7,15): BCE0020: An instance of type 'UnityEngine.Transform' is required to access non static member 'position'.

    This is the current script:

    #pragma strict



    var MaxFallDistance = -10;



    function Update ()

    {

    if (Transform.position.y <= MaxFallDistance)

    {

    Debug.Log("Test");

    }

    }
     
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Kiwasi likes this.
  3. Apple_Sauce11

    Apple_Sauce11

    Joined:
    Oct 10, 2015
    Posts:
    12
    Ok thanks