Button hover text not appearing nicely

Hi everyone, I’m pretty new to unity but I’ve come a long way without having to ask for any help around here. The time has come though…

I’ve made a little game with an inventory. It contains of several pages and on each page there’s a question mark which the player can hover for some extra explanation.

On the first page it works like this:

When hovering the question mark, the text appears. I managed that with the following code:

GUI.Button (Rect (pos.x +30, nativeVerticalResolution - image.height - pos.y, image.width / 6.5, image.height / 6.5), GUIContent (image, "Pak voorwerpen op door op ze te klikken, ze komen dan in je rugzak terecht. Klik op het boekje om een overzicht te zien van de locaties van de voorwerpen."));	
	GUI.Label (Rect (pos.x - 200, nativeVerticalResolution - image.height - pos.y + 25, image.width / 3, image.height / 6.5), GUI.tooltip);

This works like it’s supposed to.

On the next page however I run into a problem:

As you can see when I hover the question mark it shows the text twice… I have no clue why this is. I use the exact same code.

Any ideas on what might be causing this? Or maybe any alternatives on how this could be done?

Thanks in advance!

Can you post the whole of your OnGUI function? It actually gets called several times per frame update so its behaviour can be a bit subtle.

It’s kind of a big script so I attached it here.

437938–15207–$OnCollider.js (30.3 KB)

Thanks!

It doesn’t look as though there is anything in the code that would cause the problem. Is the GUI skin the same for both pages?

Yes, the GUI skin is the same.

It looks like this might be a bug. Please can you file a report for it (menu: Help > Report A Bug).