Search Unity

Resolved Hierarchy rendering bug

Discussion in 'UGUI & TextMesh Pro' started by HypnoticHumor, Dec 5, 2022.

  1. HypnoticHumor

    HypnoticHumor

    Joined:
    Oct 10, 2022
    Posts:
    8
    I've got a few canvas's that just renders some objects and buttons which use separate buttons to switch between the canvas's using .enabled, but for some reason, one of my canvas's wont render. The canvas is being enabled, so it should be rendering again but it isn't. The only solution I've found is moving the canvas out of its current location in the hierarchy, then moving it back to it's previous place and it renders it just fine, until I stop the runtime. Of course, I cant do this in the actual game build, so I'm kind of at a loss here as to why its not working. Any information would help!
     
  2. HypnoticHumor

    HypnoticHumor

    Joined:
    Oct 10, 2022
    Posts:
    8
    I also wasnt really sure where to post this thread, so i figured it was more of a ui bug since it involves a canvas, but im just starting on unity so i dont know a whole lot on terminology
     
  3. alexandred_unity

    alexandred_unity

    Unity Technologies

    Joined:
    Dec 12, 2018
    Posts:
    43
    Hi,
    is your UI made with UI Toolkit?
    Could you provide a snippet of how you "enable" your canvas?
     
  4. HypnoticHumor

    HypnoticHumor

    Joined:
    Oct 10, 2022
    Posts:
    8
    Im not going to lie, i have no clue what a toolkit is but heres how i enable the canvas

    edit:
    I also took a video of exactly whats going on but cant upload it here :/
     

    Attached Files:

    Last edited: Dec 6, 2022
  5. HypnoticHumor

    HypnoticHumor

    Joined:
    Oct 10, 2022
    Posts:
    8
    I posted a clip on youtube of my my problem and exactly whats happening
    -

    For anyone who can help, its pretty detrimental to the shop aspect of my game and i havent been able to solve the problem yet
     
  6. HypnoticHumor

    HypnoticHumor

    Joined:
    Oct 10, 2022
    Posts:
    8
    After more fiddling i found a solution that seems to work so far. I created another canvas and then put the different cars canvas inside of the new canvas, then used .enable on the new canvas and for some reason it no longer has any problems. I mean if it works, i wont complain, but i am still curious as to why this happened at all and if it was a mistake i made or something with unity?