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

loading scene changes "static int" values by itself

Discussion in 'Editor & General Support' started by Sirevix, May 9, 2016.

  1. Sirevix

    Sirevix

    Joined:
    Mar 18, 2015
    Posts:
    10
  2. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    It's very likely to be a scripting issue, not an editor issue. Also, your Enemy is adding some points to the score in OnDestroy(), which would be called when the level containing your enemies is unloaded.
     
  3. Sirevix

    Sirevix

    Joined:
    Mar 18, 2015
    Posts:
    10

    so... when unity loads a level, destroys every enemy on the hierarchy?
    i was thinking about this problem for like 3 days.. even asked on unity answers... google know's nothing about this, no one had the same problem, and no one could help me
    Thank's a lot dude....
    it was this, i let the scene open and run son enemy couldn't catch me, and when i had 20 enemyes let them kill me... and guess what, you were right.... on scene 2 i had 20 score....

    thank's again.