Search Unity

Spot the Error

Discussion in 'Getting Started' started by Lossius, Mar 12, 2018.

  1. Lossius

    Lossius

    Joined:
    Dec 6, 2015
    Posts:
    5
    I upload_2018-3-12_20-17-13.png I was following this Beginner Programming Series when i couldent replicate what he did.
    Please Help
     
  2. Lossius

    Lossius

    Joined:
    Dec 6, 2015
    Posts:
    5
    im getting this error:
    NullReferenceException: Object reference not set to an instance of an object
    TriggerEventGameObject.OnTriggerEnter (UnityEngine.Collider other) (at Assets/TriggerEventGameObject.cs:21)
     
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    You're not providing sufficient information. We need to see the inspector for the object the script is part of.

    Do you have an object selected in the field in the inspector?

    Do you have an object with the tag "Cube"?
     
    Lossius likes this.
  4. Dai-22

    Dai-22

    Joined:
    Jan 19, 2018
    Posts:
    130
    You have a private tag and a public tag, one has to be assigned (moved to cube1) using tag "player" in inspector. As cube 2 is tag "cube". Also assign this if possible. Are the gameobjects set to IS Trigger in inspector (tick box), check the video for these things. What tutorial is it?
     
    Lossius likes this.
  5. Lossius

    Lossius

    Joined:
    Dec 6, 2015
    Posts:
    5
     
  6. Lossius

    Lossius

    Joined:
    Dec 6, 2015
    Posts:
    5
    upload_2018-3-12_21-19-51.png upload_2018-3-12_21-20-0.png
     
  7. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,141
    Ugh. The answer was right in my face in the first place. Sorry about that. Try setting the "s" in "start" to uppercase. :p
     
    JoeStrout likes this.
  8. Dai-22

    Dai-22

    Joined:
    Jan 19, 2018
    Posts:
    130
    :D
     
  9. Lossius

    Lossius

    Joined:
    Dec 6, 2015
    Posts:
    5
    Thank you omg i cant belive how much time i used on this thanke you :)