Help me understand ZIndex

What’s with all the += and -= 1? Also, where does the ZIndex get directly set?

it increases the number by one (+=1) and decreases by one (-=1)
also what do you mean by directly set? It sets the CanvasGroup ZIndex value
image

You speak spanish? Learning spanish? Cool.
image

Um well you have to somehow create a new layer and set it’s ZIndex.

??? what? what does that mean, i dont know if thats a joke or not, but just in case, thats not spanish by the way, its portuguese

Sorry, my bad. Was just curious 'bout the non-english language for your search bar
(don’t reply to this)

1 Like

thats done, it alredy does that
image

it’s fine, the image wasnt there so i thought it was something about my spelling at first

1 Like

Well you were just incrementing:
image
So what I mean, is where do you set it
for example

script.SelectedLayer.Value.Connection.Value.ZIndex = targetZIndex

there are 2 pieces of code you are confusing here

There is an AddButton, that creates new Layers and sets them to ‘LO’ , it’s just a random word i picked i believe, but it basically gets the amount of layers + 1

And there are the ‘OrderButtons’ that change the currently selected layer to increase the ZIndex or decrease ZIndex by 1

And this conversation feels like it’s going nowhere, and currently i have to go sleep, i hope we can try it again later

i alredy said it, connection is the CanvasGroup, i just tried also changing LayoutOrder to see if that was the issue and thats it

Sorry, I’ve been trying to help, but I’m not the best at these kinds of things.
Someone else probably has a better answer.
I don’t really know how to help.
Sleep well, and sweet dreams. :zzz: :bed:
Sorry If I wasted your time.

1 Like

Thats fine, even if it didnt get nowhere it might help me have a new perspective at it, i just hope this is an easy thing to fix instead of being a bug and having to wait roblox to fix it, since i dont know how long bugs take to be fixed

Thanks, good night for you too

1 Like