Announcement

Collapse
No announcement yet.

UMG Text Box - Only One Option

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    UMG Text Box - Only One Option

    Hello everyone.

    So I have a text box set up so that when the player clicks on it, and types in "south" the player is translated south.

    Everything works fine, except for the player input.

    If a player types in nothing at all and presses enter the player still moves south.


    Is there any way to limit player input in the text box so that it will only move the player south if they type "south" (and not "north" or "ice cream")?


    Thanks,

    ~ Jason
    Jason's Simple Systems

    Enemy AI and Patrol: https://forums.unrealengine.com/comm...troling-damage

    Basic Quest System: https://forums.unrealengine.com/comm...ystem-part-1-1

    #2
    Seems like you are not actually working with the word that is typed in.
    Can you show me your setup?

    Normally you can add an event for the TextBox which reacts to committing the text.
    It gives you an enum which lets you check how it was committed (Enter press etc).
    Then you could search for "Switch on String" (just by right clicking). When you
    connect the text to the Switch, you will get small cast node. With the text alone
    you won't find that switch node, since the variable is of type text and the node of type string.

    The Switch on String can be modified by selecting it and looking in the left details panel.
    There you can add new Options and a Default pin.

    Default will be called if the other options aren't valid. So ice cream for example x)

    (Note: This is from my own project, so ignore the other variables in the variable tab)

    Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

    My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
    (Including 100+ Pages Multiplayer Network Compendium to get you started.)

    Comment


      #3
      You, my friend, are amazing!

      That worked exactly as I wanted it to!

      Thanks for explaining everything as well, I appreciate the detail.

      Just for kicks, here was my original setup...




      Thanks again for the help!


      ~ Jason


      Click me
      Last edited by eXi; 08-26-2015, 11:41 AM. Reason: Fixed link
      Jason's Simple Systems

      Enemy AI and Patrol: https://forums.unrealengine.com/comm...troling-damage

      Basic Quest System: https://forums.unrealengine.com/comm...ystem-part-1-1

      Comment


        #4
        Yeah ok xD you can tell yourself that your old setup would do this even with an empty text.

        Glad i was able to help!
        Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

        My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
        (Including 100+ Pages Multiplayer Network Compendium to get you started.)

        Comment

        Working...
        X