What is ZIndex?

I want to learn what ZIndex does , after researching i did find few helpful topics about it where i understood that it makes the GuiObject that has a higher ZIndex appears on top of Other GuiObjects which have a lower ZIndex , but , im questioning 1 thing , how to set ZIndex correctly? For example, is a.ZIndex=1;b.ZIndex=2 equals with a.ZIndex=100;b.ZIndex=200 ?

3 Likes

ye ziindex, depending on the value, gets displayed above others if they have the same parent, and for that example, ye its like equal but anything in between will come above A, but below B

Well , does it work whether i set its value to math.huge ?

I believe you can do that, but id you don’t have that many UI elements, it will be pretty useless. What are you trying to do?

um idk if it could work but u could just write 999999999 if u want a math.huge value.

The ZIndex property prioritizes what GuiObject will appear over any of the other GuiObjects.

Also, if you don’t know what GuiObjects are, they’re the UI elements. Like TextLabels, TextBoxes, ImageLabels, these types of things.

ZIndex essentially determines which GuiObject will appear over the rest of the GuiObjects depending on its value.

This means that the GuiObject with the greatest ZIndex value will appear over all the GuiObjects.

UI elements exist on the xy plane: they all have a fixed location of (x, y) on your screen. Think of the third dimension, z, as how far ahead they are, although we can’t see that since the screen is perfectly flat, and thus there is no depth. The ZIndex property controls how “close” a UI element renders, or in other words, which UI element renders on top of others.

Yeah, pretty much the highest value gets displayed at the top, and then the second highest value, etc. Doesnt matter if its 1,2 or 1000,2000 except between 1000,2000 you can fit 999 more objects to be displayed above the first but below the last one, and with 1,2 you can fit none.

Sir , GUIOBJECT itself tells what it is . Also ty for information and help !

1 Like

Im making a model for making many GUIs in a few line in my game

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.