Forum rules - please read before posting.

Interaction UI falls outside the screen if too many interactions

Hi,

If I start the game and click on a hotspot placed close to the left of the screen, and has five interactions, the leftmost interaction icon falls partly outside of the screen boundary, but ONLY the first time I do this in the game, and it shows correctly subsequent times.

Using Unity UI, in scene.
"Always fit within screen" is on.
Position type is "Appear at Cursor and Freeze".
The canvas field points to the canvas (taking up the whole screen) in scene.
The recttransform boundary field points to the panel, which encompasses only the icons, just like the standard example.

The layout of the interaction icons is horizontal and just like the default test menu with no changes. As I mentioned, it seems to be a first time only error, and it doesn't bug out after that.

Any ideas? Thanks in advance.

Selene

Comments

  • edited April 2021

    What are your AC / Unity versions?

    Using Unity UI, in scene.

    Is this a World Space canvas? It's typically not necessary to use "In Scene" mode otherwise. Do you have this issue if using a prefab instead?

    What's your menu's "Transition type" set to? Best to see screens of the Menu's properties and Canvas root - I'll attempt a recreation.

  • Unity version is 2021.1.4f1. AC is 1.73.6. Transition type is set to Appear at Cursor and Freeze, but changing it to none seems to make no difference. I sent you three screenshots by email - I couldn't figure out how to best post them here. The RectTransform boundary seems to revert back to "missing" when using a prefab, but perhaps that's intentional? Either way it all works other than this first time, and the prefab seems to not make a difference versus using in scene for this particular error.

    I need the canvas to be camera-based, since I use camera filters on this canvas.

    Selene

  • Thanks for the screenshots.

    This is related to Unity RectTransform components not having a valid "size" while disabled. I shall look to create a workaround, but it'll likely have to require your Canvas root to have a Canvas Group component attached to it.

  • Hi Chris,

    I've tried looking into this for a bit but have not managed to find a solution. I have a Canvas group attached to the canvas root, which I assume may still not help before this workaround is done, but is there anything else you need from me or should I just assume that it will be fixed in a future version? (I am not particularly in a hurry, just wanted to know if you need me to try anything else).

    Selene

  • Thank you - no, I think I have all the details I need. I've recreated the problem with the default interface.

    The Canvas Group indeed won't help until the next update is out, but that update should be able to address the issue.

  • Thanks for the update, Chris.

  • @ChrisIceBox
    Hi Chris, I have the same problem with Interaction UI.
    using AC v1.73.2
    source: Unity UI Prefab
    appear type : On Interaction
    position type: Appear at Cursor and freeze
    always fit within screen? True
    RectTransform boundary is set to the first panel child, contains 30+ buttons referenced, anchored to the top-left
    problem: when the hotspot is close to the bottom boundary of the screen. first time you click on the hotspot it draws the menu at pivot and menu will be partially out of the screen even if one interaction button is enabled.
    any suggestions?

  • You'll need to update - the issue above was encountered in v1.73.6 and fixed in the release that followed.

  • I have added lots of lines to AC scripts. I can't risk losing them by updating to a new version right now.
    could you please help me to find the solution in newest version and add it to my project manually?

  • I recommend relying on AC's custom event system to avoid modifying its scripts to extend functionality.

    I will see if I can find the change that was made in v1.73.7 that fixed the issue.

  • I recommend relying on AC's custom event system to avoid modifying its scripts to extend functionality.

    I've used events as much as possible but in some areas I had no choice but changing parts of AC codes.

    I will see if I can find the change that was made in v1.73.7 that fixed the issue.

    thank you very much, it would be great if you can address the file or method corresponded to the issue.

  • I have PMd you a link to a package that contains the two files related to the fix: PlayerMenus.cs and Menu.cs.

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.