Hello,
I am having a problem with my GUI.Label. I am trying to get it to display variables in my code for debugging etc. but when the variable changes it overlaps with the previous and i end up with a mess (see screenshot)
[10479-overlapping+gui.jpg|10479]
I have looked for solutions online but not found something solid enough to fix this problem. Has anyone ever come across this. Here is my GUI function, as short as it is.
void OnGUI()
{
GUI.Label(new Rect(15, 15, 150, 30), "isJump = " + leftThumbValueX);
}
Is it possible that you maybe have a second label which gets displayed at the same location? I never saw a case where a single label can overlap. There has to be a second label displaying something like: "isJump = " + anotherValue or something like this.
– ExTheSeaNo this is the only instance of this function in my script there is also no other version of this function in any of my other scripts. I can't get my head around it :\
– BenjamAre there maybe two instances of this script active at the same time. ...maybe attached to different gameobjects?
– ExTheSeaHmm, so I removed my movement script from my character and the GUI ran perfectly well....Is there something I am missing when using OnGUI? To test this out i put OnGUI in a separate script and assigned it to my character, it worked well except it ruined the controls....
– BenjamI have attached the movement function to a main object in the scene that is a parent of a few other bits and pieces....could this be why its overlapping?
– Benjam