Forum rules - please read before posting.

Unity UI - Inventory item names via follow cursor

edited April 2021 in Technical Q&A

AC Ver: 1.73.2
Unity Ver: 2019.4.18f1

Hello,

I'm in the process of updating my inventory UIs to use Unity UI prefabs.

Previously I had the AC inventory menu setup using two menus; one to show the inventory and another to show item names on mouse over under the cursor, like so:

I really liked how the name menu was offset below the cursor. Good times.

However since changing the menus to use Unity UI prefabs the menu which shows the item name no longer has an offset with the cursor:

This is rightly set to 'Follow Cursor' but what do I need to do in order to get it appear offset from (below) the cursor?

Comments

  • When AC repositions a Unity UI-based menu, it does so by centering the RectTransform, assigned as that Menu's RectTransform boundary field, over the intended position.

    If you need the text shown in that menu to be offset from that, you need to offset the text in the Hierarchy. One way to do this is to create an interim RectTransform in between the Canvas root and your Text object, and assign this as the boundary. That way, you can control the local position of the Text as part of the prefab, and still have AC handle the main position.

  • Thanks Chris. Good to know how the RectTransform is used. All good now.

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.