• Advertisement
Sign in to follow this  
  • entries
    2
  • comments
    5
  • views
    3213

About this blog

fun, learning based games for healthcare providers

Entries in this blog

Just had my first lesson in script execution order in Unity.

I have a MyMethod() within Update() that looks to a static integer set by another script. MyMethod() was not functioning because upon starting the game, the method would break due to the static int being set to 0. The static in question is dynamic but it's range is not allowed to fall to 0 per it's script. How on earth could it be 0?? Then I decided to debug.log the static in Update() and upon Start(). I found that the static was 0 in the first frame, then it would set correctly from the script that initializes it every frame after. However, just one frame of 0 was all it took to break my method within Update(). I'm sure I could get around this other ways but I found the quickest way to fix this issue was to use the script execution order in Unity. I set the script with MyMethod() to run last, allowing Unity time to initialize the static integer. I won't tell you how long it took me to diagnose this, but I'm writing this post out of relief. Anyone else encountered this?

I've enjoyed reading and looking at the interesting things you guys do on this site. Please go check out my game and tell me what you think.

The game: https://www.mysicu.com/games/EKGSimulator/index.html

Reddit post: https://www.reddit.com/r/nursing/comments/5ygpx1/update_i_created_an_ekg_game/

I'm a nurse trying to learn game development because, I have fun doing it, and because I want to create more exciting learning experiences for healthcare providers. I have a million and one ideas, just trying to learn as fast as I can, if anyone is willing to answer questions, let me know.

[sharedmedia=gallery:images:8384]

Learning Mode:

[sharedmedia=gallery:images:8386]

Play Mode:

[sharedmedia=gallery:images:8385]

Contact me through

Facebook: https://www.facebook.com/VirtualRnEducation/

IG: Virtual.RN

Twitter: Virtual_RN

Sign in to follow this  
  • Advertisement