Forum rules - please read before posting.

Auto Correct UI Dimensions

edited July 2023 in Technical Q&A

Hi

Can someone give me some advice on setting up the Auto Correct UI Dimensions component? Currently it appears to work, but then prevents the player from clicking on the screen to move the Player.

I want to have a fixed 16:9 ratio with letter box lines outside that. I've got a main onscreen UI component and I've added the component to my on screen UI canvas and set the transform to the rect transform (which is the panel under my canvas). I've changed the pivots in the component. It works, but no clicking works.

I've noticed that the manual states "To use it, attach it to the UI prefab's Rect transform boundary. This should be an
immediate child of the Canvas" however if I add it to a child of the canvas it says it needs a canvas and doesn't work. Not sure if this is correct or not.

https://imgur.com/a/NC9YOIj

Unity 2022.3.4.f1 LTS
AC 1.77.2

Any ideas how I can have it resize my UI and allow clicks such that the player can move about?

Olly

Comments

  • The component is right, the Manual is wrong - thanks for letting me know.

    Attach the component to the root, and assign the immediate child as the "Transform to control" - this should be the same as the Menu's "RectTransform boundary".

    The component itself simply repositions the assigned RectTransform - it won't itself interfere with clicks in the scene.

    However, if a click is made over the "RectTransform boundary", which should describe the visible boundary of the Menu, then this will block clicks in the scene.

    Does your Menu span the entire scene? If so, you might need to break it into separate Menus for each corner.

  • Thanks Chris. I played with the components Anchor settings and set the min X to 0 and Max X to 1, which appears to have worked. I also noticed an issue with the child recttransform not being stretched correctly.

    All appears to be working now. Thanks.

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.