Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

World Space Canvas VS Screen Space - Camera Canvas

A topic by RubyDev created 14 days ago Views: 73 Replies: 7
Viewing posts 1 to 8

Hello, I thought I might make a new topic for this.

I am not actually sure if this is a bug on your end or on my setup, but I think it might be a bug with the asset.

It seems world-space canvas text will always be drawn, even if overlapped by e.g.: an image/panel in a screen-space-camera canvas. In the screenshot you can see how the panels order correctly but the text will show above the other panel. I also screenshotted the inspector, maybe you can also set it up to see yourself.

It's not a big problem for my game cause actually the world space canvas will probably be front-most... probably!? 

But I wanted to report this nonetheless.


(1 edit)

PS: I just found out this only applies when on the Ultra shader. On the Universal it works as intended!

Developer

Hello, (and thank you for making a new topic)


Did you use the new build I sent you for the last bug with this? I changed some values in regards to this in that build specifically, so I might have messed something up. So... need to know which one is being used here so I can determine what's gone wrong!

Funnily enough, no this was on the old build. Sorry, I should have mentioned that.

I did try the new build and the outlines worked but then I had some scaling issues in my project so I reset, but then it turned out it didn't have anything to do with the new build. So now I am yet to go to custom-sent new build again.

So the build in this version is the one that you get from Unity asset store.

Developer (1 edit)

Ok, please try the new build I sent you then! It had a change made to fix ordering, so I'm hoping that does it. The change is that in "STMultra.cginc" there's a line like this:

#if UI_MODE
zed -= 1000;
#endif

...And honestly, from some quick edits, I think I'll change that to 999999 in the next release, seems to give an even more consistent result in all canvas modes.


So does it give the results you want in the version with that code? What if the value is changed to 999999? Hoping to publish these updates soon if it all looks good! (There were lots of ultra shader changes made for v1.14.0, so still fixing up some of the loose ends like this... sorry for the trouble!)

Had to re-open Unity 'cause I closed everything already for the night but I just tried it:

zed -= 1000;

Fixed the issue in the screenshot.

Funnily enough 999999 also seems to have fixed it. I tested out some stuff and it vanishes at -4 and lower and at 31 and above.

(All tested in the old version.)

Now in the new version. (First of all, I get a few error messages. I made a screenshot but I assume those are because it's maybe new import and not finalized version yet.)
After the update, the number was 1000. At first it was not fixed but I restarted Unity and now it's working. 

Again, I don't know how much those error mean to you but I am going to bed over here now so here they are for good measure:



Thank you for your help. I am glad to be of help!

Developer (1 edit)

I don't think the old version of the shader had the exact same code as the new one, so I have no idea where you'd be inserting that line. (This line is meant to only be active for UI text specifically, by the way!) Please use the new version of STM I sent you, it should be viable as a release candidate!

When updating shaders/cginc files, you may have to right click on the shader or folder containing the shader and select "Reimport" to update it without needing to restart Unity.

If that error persists, go in to the Text Data Inspector, and click the button at the bottom that says "Refresh Database" and see if that fixes it. Line 6018 doesnt line up with my working build anymore so I'm not sure which line is truly causing that error, meanwhile line 108 in STMQuadData tells me that the texture of the quad is null... Which would be caused by the blank quad I told you to make. Oops... I suppose I meant to use a blank texture in this regard, not actually leave the field null. All the more reason for me to figure out a more concrete answer to altering the size of spaces...

I can update the build and send it again if you like!

Ohh, in the old version I found a line of code by looking for "if UI_MODE" called "zed -= 1" and I changed that and that did fix it in the old version.

But in the new version you sent me it was fixed by default so all worked fine in the build you sent me.

I think I don't need a new build right away again, I'm fine waiting,  it's not urgent.