Search Unity

Bug Nullref inside fsm script node on exit from play mode

Discussion in 'Visual Scripting' started by mouurusai, Aug 9, 2022.

  1. mouurusai

    mouurusai

    Joined:
    Dec 2, 2011
    Posts:
    350
    Hello. How to get rid of nullref? The object is assigned in edit mode, so it's definitely there. upload_2022-8-9_18-17-8.png
     
  2. mouurusai

    mouurusai

    Joined:
    Dec 2, 2011
    Posts:
    350
    Bump. Maybe there is some workaround? This error little irritating when i need to use the debugger.
     
  3. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,079
    Perhaps logic elsewhere sets GamePanel variable to null? Does GamePanel still has the value there at the time of error?
     
  4. mouurusai

    mouurusai

    Joined:
    Dec 2, 2011
    Posts:
    350
    No, the object is definitely not destroyed. I tried to add the "Null check" node, the error is fixed, although I'm almost sure that I had already tried checking for null before and it didn't work, maybe it worked because of the Unity version change.
    In general, the problem is not in the nullref itself, but in the fact that FSM changes state on exit from game mode, this can cause many harmful effects, such as saves damaging.