Forum rules - please read before posting.

problems with gui after turning it to prefabs

I have several menus in scene that I turned to prefabs - and then turned them off. When I turn off Unity and reload the project, the menus in AC seem to lose RectTransform from many of the menus - also some button links go missing. UI works ok, but if I want to make changes I need to set the menu right again - and if I try to set the RectTransform from prefab, the canvas size is going to be set as RectTransform area taking all clicks.

U2020.3.15f2 AC1.73.8

Comments

  • Your assigned "RectTransform boundary" must be a child of your Canvas - ideally an immediate child, that spans the visible area of the UI elements it contains.

    The direct connection will be lost due to it being a child of a prefab - but if the Constant ID number associated with it matches, the connection should be restored at runtime. Check that the recorded ID in the Menu's properties matches that on the Constant ID component attached to your "RectTransform boundary" object.

    Share screens of the Menu's properties, the prefab's hierarchy and Inspector of the object you're assigning as the RectTransform boundary and I'll take a look.

  • It seems to have been a misunderstanding. When I looked at the prefabbed menu, I tried adding RectTransform from prefab directly and so replaced the panel RectTransform with canvas one.
    I had a ingame menu with a lower left menu button panel and upper right ingame inventory panel, but it seems I had set the canvas as RectTransfer from prefab.
    It would be nice to have a comment there on menu when you do switch to prefabs to prevent misunderstandings.

  • The Manual's "Unity UI menus" chapter details what should be assigned as a Menu's RectTransform boundary.

    Typically, this boundary should span all objects that make up the menu - with as little unused space as possible. If you have a menu that takes up both the bottom-left of the screen as well as the upper-right, you're better off splitting it into two menus.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.