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

[ERROR] Exported game doesnt work

Discussion in 'Getting Started' started by Jozzuph, Oct 1, 2019.

  1. Jozzuph

    Jozzuph

    Joined:
    Sep 12, 2019
    Posts:
    33
    https://pastebin.com/cKRXF4XY (Player Script)

    https://pastebin.com/jH64tFUx (Enemy Script)

    This is my first program, I need help, it works in the editor, but not when I Export it... (In any of them), in the debug mode it says there is also something wrong with line 30 of the enemy script. Please help as simply and soon as possible.

    It works fine in the editor, but not when it is exported...

    (Error in the editor when a player is destroyed:
    NullReferenceException: Object reference not set to an instance of an object
    SquareEnemy.Start () (at Assets/GameScripts/SquareEnemy.cs:20))
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please don't use external links, use the Code tag from the little editor bar above ^^