- Home /
Script Component unchecks itself prior to build.
Hi all,
I am running into an unusual problem here, currently whenever I play test my project the Player Health script that I created on the player object unchecks itself. I can easily fix the problem by going into the inspector and reclicking the script (i.e checkbox) however once the build is completed and I restart it unchecks itself.
Please note that the box is checked before I build the game and unchecks itself upon starting.
Cheers,
You most likely have a line of code in either that script's start function or in another scripts start function that is setting gameObject.SetActive(false). Check your scripts to make sure this is not the case.
Answer by 1Riptide · Dec 13, 2017 at 04:11 PM
In my case I had a commented out code block inside of an otherwise empty Start() method. Once I removed the Start method, or un-commented the contents therein all was well. Very strange behavior indeed.
Unity vs. 2017.2.1