- Home /
Unity4 Ignoring Inspector/Initialized Public Value in Build
I currently use a controller.move call, multiplied by a moveSpeed float and Time.Deltatime. This call works perfectly in Unity 3.5.6 and all earlier versions I utilized (in both editor and build) & Unity 4 Editor Game Window. However, as you can see below: the problems begin when I build my project.
Click here for Screenshot (Unity Support Forum Post):
I originally had moveSpeed initialized at 5f, and that would be replaced by the public inspector value (as different entities move at different speeds). Unfortunately, Unity4 builds ignore moveSpeed initialization and public inspector value entirely. There is no where in this code where the value is every set (it is only multiplied against values like sprintMultiplier). Additionally, the only workaround I have found is to 'hard-code' the moveSpeed to 5 in the Actions call.
The real problem with nailing down this problem, is that it DOES NOT OCCUR IN THE EDITOR. If you notice, I had to use the game-console window to output Debug.Log statements because I cannot recreate this bug in Unity4 builds.
If anyone has a solution or insight on what I might be doing wrong, or if this is a known error; I would really appreciate it, as this is single handedly keeping me from updating to Unity 4 atm. (well, maybe not by itself; there's some really crappy frame rates associated with OnTriggerEnter...but that's a whole other beast.
Answer by Wolfram · Jan 23, 2013 at 12:03 PM
Try renaming the variable, there might be some corruption in the script's metadata.
Your answer
Follow this Question
Related Questions
Error with my float variable? 1 Answer
Game works fine in editor, but build fails with 59 error in the console 2 Answers
Unity pro 4, shadow problems 0 Answers
Unity Editor's Inspector Glitch while using OnGUI function 0 Answers
transform.position = new Vector 3 NOT moving to correct position? 1 Answer