Script working in BUILD but NOT in EDITOR
This is strange because I've found tons and tons of problems where people scripts don't work in the build but DO work in the editor. My problems are the exact opposite. In the editor I get some scripts that are either not working as intended, the movement is sometimes kind of glitchy (like it skips forward instead of moving smoothly), and even when some sciripts go active the gameobject will return to the origin to execute. Whenever I run them in the build or sometimes on my PC vice laptop it works completely fine (although the problems aren't isolated to my laptop they do happen more frequently on it). Any ideas why this is happening? I've noticed sometimes things like collision variables come back sporadically true and false vice constantly true which makes me wonder if maybe the editor is just using too many resources and the computer cant process everything the same way every single frame but this is a total guess. Any ideas!?!?
Answer by NtkyLetudiant · Feb 20, 2017 at 11:04 AM
Do you have debug code written ? Sometimes, debugging code slows down the program and it could run better.
Also, for the variables being true or not along time, I already had that issue in older projects in C# and C++. I had forgot to define the size of one array I had created before initializing it. Defining is :
public Jaa[2] listeDePanneaux;
On above example, 2 is the size.
In Unity project, I use type short or int to get around intempestive boolean changes.
Your answer

Follow this Question
Related Questions
The variables modified in the inspector are not kept on build 0 Answers
Script working in Editor but not in Build 1 Answer
really weird unity behavior please HELP???? 0 Answers
is there any way to select gameobject by script in hierarchy ? 0 Answers
Game Manager loses reference to GUIText gameObject on a new scene 1 Answer