Forum rules - please read before posting.

binding interaction with keys defined per deployment

I'm creating a hand, paper, scissors- minigame. I'm now wondering how to create player interaction. I have an idea of having three buttons player can press with mouse button, but since the idea would be that the NPC starts forming the gesture a bit earlier then the player, he would have a brief moment to react correctly - and so I thought binging keyboard keys to same interactions.

I had a thought of creating new conversation menu with these three buttons. This way I could get the count down easily with it. Can I use somehow a circular count down element?

I was also hoping the same solution to work ok with Nintendo Swift.

Comments

  • I thought binging keyboard keys to same interactions.

    You can run a specific Conversation option by calling its RunOption function. You can listen in for specific keys and run it in a custom script:

    private void Update ()
    {
        AC.Conversation conversation = AC.KickStarter.playerInput.activeConversation;
        if (conversation && AC.KickStarter.stateHandler.gameState == AC.GameState.DialogOptions)
        {
            if (Input.GetKeyDown (KeyCode.A))
            {
                conversation.RunOption (0);
            }
        }
    }
    

    Can I use somehow a circular count down element?

    You can use the "Fill Amount" property of a UI Image component to create a radial progress bar - see this tutorial.

    Conversation timers in the Menu Manager can be created using a Slider element. To map to an Image's "Fill Amount" property, you can have a script map it to the Conversation class's GetTimeRemaining function:

    public UnityEngine.UI.Image image;
    
    private void Update ()
    {
        AC.Conversation conversation = AC.KickStarter.playerInput.activeConversation;
        if (conversation && conversation.isTimed)
        {
            image.fillAmount = conversation.GetTimeRemaining ();
        }
    }
    
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.