Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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.