Forum rules - please read before posting.

Conversation menu (Above Player)

Hi, I have a couple of questions regarding the Conversation menu.
I'm working on a 2D game, and my Conversation menu floats above the character's head.

  • The problem I've encountered is that when a character is near the edge of the screen, the UI gets cropped. (https://imgur.com/xD6UuQ3) I think this is more of a Unity C# script problem, but I was wondering if there might be a simpler solution with Adventure Creator.

  • Is there a way to turn off the Conversation Menu by clicking outside of the UI?

Thank you so much.

Comments

  • The problem I've encountered is that when a character is near the edge of the screen, the UI gets cropped. (https://imgur.com/xD6UuQ3) I think this is more of a Unity C# script problem, but I was wondering if there might be a simpler solution with Adventure Creator.

    Under the conversation menu options, you can check "Always fit within screen?"

    Is there a way to turn off the Conversation Menu by clicking outside of the UI?

    If I understand you correctly, you just want the menu to disappear when you click anywhere? If so, under the Speech manager options, you can select "Subtitles can be skipped?"

  • Hi, thank you for pointing out the need for clarification.

    I double-checked, and the "Always fit within screen" option is already enabled. The "Subtitles during gameplay can also be skipped" function isn't working either.

    The Conversation Menu appears to operate differently from other menus. The options to turn off or lock the menu were unsuccessful. I tried using the "EndConversation" with the Object Call Event, but it didn't work. Or perhaps I did it wrong – I'm a novice to scripting.

    Additionally, there's another issue: the "Speech menu placement child" function doesn't work when I set the Conversation Menu (which has a DialogueList) to the 'Above Player' position type.

    This is a link to my settings for the Conversation Menu
    https://imgur.com/Tx4vLGM

  • I'm not sure why "Always fit within screen" isn't working. Chris should be able to advise you.

    But apologies, for some reason I thought we were talking about speech menus! To click outside the conversation menu to close it, I'd try something like this:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using AC;
    
    public class CloseConversationMenu : MonoBehaviour
    {
        Menu ConversationMenu = PlayerMenus.GetMenuWithName("Conversation_SpeechBubble");
    
        void Update()
        {        
            if (ConversationMenu != null)
            {
                if (KickStarter.playerInput.GetMouseState() == MouseState.SingleClick)
                {
    
                    if (!ConversationMenu.IsPointInside(KickStarter.playerInput.GetInvertedMouse()))
                    {
                        AC.KickStarter.playerInput.EndConversation ();
                    }
    
                }
    
            }
    
        }
    
    }
    

    Does it work?

  • I double-checked, and the "Always fit within screen" option is already enabled.

    This option works by adjusting the position of the "RectTransform boundary" assigned at the bottom of the Menu's properties.

    Typically, this should be an immediate child of the Canvas that spans the full width/height of the visible content, which themselves are parented to this boundary. You can use Unity's provided "Content Size Fitter" etc components to have it expand/shrink based on the content of its children.

    The "Subtitles during gameplay can also be skipped" function isn't working either.

    AC will re-position menus by adjusting this same "RectTransform boundary" - but will also account for the screen edges if the "Always fit within screen?" option is checked.

    After making sure the boundary accurately describes the visible content (as above), try temporarily unchecking the "Always fit" option, so that you can see the effects of positioning without interference from the screen edge.

  • @Rairun Thank you so much for the script! However, I'm still facing some challenges getting it to function correctly. I found this post (https://adventurecreator.org/forum/discussion/9421/end-conversation-action). But I couldn't replicate the situation - when I create a hotspot in the Hierarchy, it's unclickable since the Conversation menu Canvas overlaps the game scene.
    I tried yours but it still doesn't work. I believe it should have worked, so I will give it another shot.

    @ChrisIceBox Thanks for pointing out the "RectTransform boundary" issue. My panel was set to 0,0 for width and height. I struggled all last week trying to figure it out. Thanks again.

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.