Quantcast
Channel: Latest Questions by guto-thomas
Viewing all articles
Browse latest Browse all 84

OnEnable() isn't getting called after reloading a scene

$
0
0
Hey everyone! I want to ask for some help in my project. It works this way: Is kind of a tower defense game where I need to defend the base against spiders, and I have a system based on waves. A wave has properties like duration, maximum number of spiders, etc. When the wave ends, the script which controls it is disabled and reenabled when the player press the 'next wave' button. Then, the OnEnable is called in the WaveControl script and I have a lot of important things going on in the OnEnable function and the problem comes when I loose the game and need to restart it. So, when I click 'try again', the scene is reloaded but the problem is that the OnEnable function of WaveControl isn't called anymore! Even if I enable/disable it by hand, I can't get a simple print I putted in the function. Anyone has an idea of what could be the problem? Thanks from now!!

Viewing all articles
Browse latest Browse all 84

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>