I have the problem, that some scripts don’t run completely.
Script example:
function manipulate(){
if(Input.GetKeyDown(KeyCode.E) && !ShowContContent && Inv.Movement && !Locked){
ContOpen.Play();
ShowContContent = true;
Inv.Movement = false;
Inv.ShowCon = true;
}
}
function OnGUI(){
if (ShowContContent){
GUI.DrawTexture(Rect(0, 0, Screen.width, Screen.height), ContBackground, ScaleMode.StretchToFill);
[...]
}
}
If i hit the key, the sound plays, but nothing else happens. That means, the script runs, but not completely. Most times when the window is open already, so I can’t leave the window anymore. By buttonsmashing it works sometimes once per 30 inputs.
I think it could be caused by the framerate.
What can I do to fix that?