Forum rules - please read before posting.

Controller-based conversation option selection + hotspot labels

I have an icon only dialog list (Display type: Icon Only) in my conversation menu and I have enabled the 'Directly navigate during Conversations' option.

When I switch to controller, I am able to select a conversation option using either the d-pad or the left stick, but I have noticed that the right stick still controls the (hidden) cursor that displays the hotspot label of the selected conversation option, thus being able to move it on the screen.

Is there a way (custom or not) that I can have the conversation option hotspot labels appear on a specific point in relation to the selected conversation option and disable the right stick of the controller during conversations?

Comments

  • You can use a custom script to lock the cursor, and affect the locked position.

    If you're using Unity UI, it's a bit tricky but it should be possible to read which element is selected and extract its screen position. Something along these lines:

    void Update()
    {
        Menu menu = PlayerMenus.GetMenuWithName("Conversation");
        if (menu.IsOn())
        {
            KickStarter.playerInput.forceGameplayCursor = ForceGameplayCursor.KeepLocked;
            foreach (var element in menu.visibleElements)
            {
                if (element.IsSelectedByEventSystem(0))
                {
                    var rect = element.GetObjectToSelect().GetComponent<RectTransform>();
                    var screenPosition = new Vector2(rect.anchorMin.x*Screen.width, rect.anchorMin.y * Screen.height);
                    KickStarter.playerInput.OverrideLockedCursorPosition(screenPosition);
                    break;
                }
            }
        }
        else
        {
            KickStarter.playerInput.forceGameplayCursor = ForceGameplayCursor.KeepUnlocked;
            KickStarter.playerInput.ReleaseLockedCursorPositionOverride();
        }
    }
    
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.