ZindexBehaviour for plugins

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

I have some final debugging questions and comments.
Are you sure that when you create a new layer that it is selected? (just in case)
And, manually check the ZIndex through your script, ther might just be something wrong with your code.
And lastly, make sure when you select a new layer that the ZIndex selector thing is aligned with the actual ZIndex

1 Like

oh my god i found it
image

i have to change testWidget.ZIndexBehavior, i will try that now

local testWidget = plugin:CreateDockWidgetPluginGui("IconMaker", widgetInfo)

image
it worked, i just have to fix the background image

For anyone having the same problem, here is how to fix it:

local widgetInfo = DockWidgetPluginGuiInfo.new(
	Enum.InitialDockState.Float, -- Widget will be initialized in floating panel
	false, -- Widget will be initially enabled
	false, -- Don't override the previous enabled state
	800, -- Default width of the floating window
	800, -- Default height of the floating window
	600, -- Minimum width of the floating window (optional)
	600 -- Minimum height of the floating window (optional)
)


local YourWidget = plugin:CreateDockWidgetPluginGui("WidgetName", widgetInfo)
YourWidget.ZIndexBehavior = Enum.ZIndexBehavior.Sibling

thank you so much @Mystxry12 and @Userunmanned for helping me

1 Like

Even though I think I did almost nothing, I’m glad you found the solution. :grinning:

1 Like

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