#UI Overlay Layering

1 messages Β· Page 1 of 1 (latest)

untold imp
#

Lets continue here @bold cloud

bold cloud
#

aight

untold imp
#

That chat is driving me nuts. So, first ctrl z back to your correct transform values.

#

But I guess, they get overriden anyway when instantiated

bold cloud
#

If I ctrl Z it also put the renderer back to world space. I'll just input the transform values again.

#

But now I don't have the sorting layers...

untold imp
#

Show your inspector again

bold cloud
untold imp
#

Remove the renderer ! πŸ˜‰

bold cloud
#

I can't, because Image (script) depends on it ??

#

The hell is that

untold imp
#

Okay, so what did you open. the PilePreview. Is it a prefab?

bold cloud
#

it is

untold imp
#

Can you show the inspector and hierarchy when its being loaded?

bold cloud
#

Oh, all my prefabs have a canvas renderer, that's funky

#

I'm specifically trying to get the preview over the end turn button

untold imp
#

Well that is wrong that they have a renderer πŸ˜„ That should not be the case

bold cloud
untold imp
#

Why the heck is it all green... πŸ˜„ I could never work with that πŸ˜‰ Okay. So can you put your prefab in edit mode into the place where it should be, remove the renderer and then make a new prefab out of it or override it?

bold cloud
#

huh, all my objects have one actually

untold imp
#

Ohhh, well... somethings going on here thats not meant to be.

bold cloud
#

I didn't add them that's for sure, they're here by default

untold imp
#

Does your root canvas have a renderer?

bold cloud
#

yup

bold cloud
untold imp
#

Can you show your root canvas inspector?

bold cloud
untold imp
#

Well that looks right. I just think that all your child objects are basically their own UI system within itself

bold cloud
#

So I should rework it all so that all the renderers are gone ?

untold imp
#

Sounds like. Just make a new unity UI for testing. then add an empty gameobject to it and add an image component

bold cloud
#

a new unity UI ?

untold imp
#

Right click in hierarchy, UI Canvas, but be sur eto not select any gameobject, so it gets on root of the hierarchy

bold cloud
#

Oh, ok

#

I added an empty to a new canvas, and yeah when I add an image a renderer just pops

untold imp
#

What the heck πŸ˜„

#

No wait, I guess this is okay, just checked, it can work with or without that.

bold cloud
#

Well that's a relief

untold imp
#

Okay, lets ignore the renderer for now. I tmight be okay to have it in.

#

So what about if you add canvas to it

#

What does the component look like for you?

#

Oh boy, yeah I am sorry about the renderer, just chcked. most of my system is dynamic, so I barely had any image, but those i have, have a renderer. I guess visual stuff like image needs it. so ignore that renderers are bad on children πŸ˜„

bold cloud
untold imp
#

to your previewGameobject. the prefab you instantiate

bold cloud
#

so, that ?

#

That the instantiated prefab

untold imp
#

There it is, override sorting

bold cloud
#

The problem is that it doesn't at all look like that from the prefab itself

untold imp
#

click it! and set the order to whatever you want.

#

What does the prefab look like?

bold cloud
#

So I can't really pre-set it

#

I don't have override setting there

untold imp
#

Oh because of prefab mode

bold cloud
#

Ah yeah if I open it I get the thing

#

that's strange

untold imp
#

thats unity πŸ˜„

bold cloud
#

the gift that keeps on giving

#

welp, I suppose it should work now, but I'll test once I've fixed another issue : when I make the window bigger, everything moves around like mad and it is very inconvenient. I'll tell you if that works once I can test it x)

untold imp
#

You should really look into relative positioning.

#

Instead of setting your position in your prefab, calculate it when instantiating. So take your pile button for example and plus vector2 to position it, so it will always be placed at the correct place

bold cloud
#

Yeah that's what I do

untold imp
#

Oh well, whats th eother issue?

#

I guess you have some messed up pivots/anchors then?

bold cloud
#

It's unrelated, I guess I'm just instantiating things wrong

#

I suppose so, though I don't know what either of those are. I'll figure it out.

untold imp
#

Alrighty, then I leave the thread here, alright?

bold cloud
#

Okay !