Announcement

Collapse
No announcement yet.

Touch Buttons?

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

    Touch Buttons?

    I've tried to look around for a while now to find anything on how to do proper Touch Buttons as compared to Touch Joysticks.

    I'm doing a Side Scrolling Endless Flying game and the precision needed to survive just can't be achieved with the standard virtual thumb joystick.
    When I play it on the PC the keys I press gives a constant 1 or -1 depending on whether I press Up or Down whereas the Joystick goes between 0.0 to 1.0 or 0.0 to -1.0. While this is how a normal joystick works (deadzones and all) this is not desirable for my game. I'd like to have touch buttons that work the same as my keyboard buttons. Fast and Precise.

    But achieving this have so far been a big problem. I first tried to achieve it through UMG but that failed.
    Then I tried to achieve it by making touch buttons but I could never configure the Touch Interface to the point where it works like buttons. It's still just Joysticks.
    I would really appreciate any help with this, as it's paramount to making my game enjoyable

    #2
    Does no know still don't know anything about touch controls?

    This seems like a heavily under-developed part of the Unreal Engines mobile department.

    Comment


      #3
      UMG is the way to do this. Did you start a thread asking about the problems you encountered?

      Comment


        #4
        Originally posted by NickDarnell View Post
        UMG is the way to do this. Did you start a thread asking about the problems you encountered?
        Quite a while ago: https://forums.unrealengine.com/show...k-Control-help
        There seems to be no help on how to do Touch Buttons that work like you'd expect a button on a keyboard or keypad to work. I tried to do it through UMG but I only ran into "Infinite Loop" stack problems.

        Comment


          #5
          Nothing in that thread about UMG. Buttons in UMG work like normal buttons, you just call a function when they're pressed and released to tell the player to run/jump whatever.

          Comment


            #6
            Originally posted by NickDarnell View Post
            Nothing in that thread about UMG. Buttons in UMG work like normal buttons, you just call a function when they're pressed and released to tell the player to run/jump whatever.
            Yeah, that doesn't work. I press the button I made (Using the OnPress Event) and the ship I got moves 1 unit along the Z axis when it's supposed to keep moving as I hold down the button. I have to repeatedly tap it to move.

            Comment


              #7
              Press is only fired once until it has been released. Sounds like an issue with your game code, what are you doing after a button is pressed? Are you setting a bMove variable to true when pressed and updating the location every frame?

              Comment


                #8
                Originally posted by NickDarnell View Post
                Press is only fired once until it has been released. Sounds like an issue with your game code, what are you doing after a button is pressed? Are you setting a bMove variable to true when pressed and updating the location every frame?
                Why is there no event for when you keep pressing? When I press a keyboard button I don't have to do any fancy variable modification to make it work. I just do this:

                Click image for larger version

Name:	5b9118b94c.jpg
Views:	1
Size:	53.2 KB
ID:	1082208

                Comment


                  #9
                  That event will fire regardless, if you aren't pressing it the axis value is 0. You can store a boolean that is set to true when you press the button, and false when you release. As long as that bool is true you know the player is holding the button down.
                  Columbus Ohio Unreal Meetup
                  @OCGameStudio | Sphere Complex | twitch.tv/WFMOz

                  Comment


                    #10
                    Originally posted by TheFoyer View Post
                    That event will fire regardless, if you aren't pressing it the axis value is 0. You can store a boolean that is set to true when you press the button, and false when you release. As long as that bool is true you know the player is holding the button down.
                    I want to deploy this on mobile. The Joystick doesn't cut it. I need touch buttons.
                    There are no touch buttons. UMG is how to do it you tell me. But there are only roundabout weird ways of pulling off continuous button pressing.

                    There are no accessible Input Action nodes in my UMG blueprint.
                    Last edited by OmniOwl; 07-21-2015, 05:36 PM.

                    Comment


                      #11
                      So you got nothing..?

                      Comment


                        #12
                        Look, I don't have any experience with mobile dev. You need to do more troubleshooting. Is the axis value not printing anything at all on touch. Do you even see the buttons on the screen? Why haven't you tried this with UMG yet? Maybe this is a bug but I haven't seen you post on answerhub yet. There are probably a million other things that you're going to have to try and figure out. We can only help so much. And remember we all volunteer our time here to help and answer questions..
                        Columbus Ohio Unreal Meetup
                        @OCGameStudio | Sphere Complex | twitch.tv/WFMOz

                        Comment


                          #13
                          Originally posted by TheFoyer View Post
                          Look, I don't have any experience with mobile dev. You need to do more troubleshooting. Is the axis value not printing anything at all on touch. Do you even see the buttons on the screen? Why haven't you tried this with UMG yet? Maybe this is a bug but I haven't seen you post on answerhub yet. There are probably a million other things that you're going to have to try and figure out. We can only help so much. And remember we all volunteer our time here to help and answer questions..
                          In the opening post I wrote:

                          Originally posted by Vipar View Post
                          I first tried to achieve it through UMG but that failed.
                          There are no "Pressed" and "Released" executive pins on any nodes you can spawn in the UMG section of the editor, like there is in the blueprint editor for my Character. While I understand this is voluntary, not even the Developers of the Engine it seems, know the answer to this particular problem of wanting Touch Buttons. It's just a bit confusing to me, considering Epic Games seems to have wanted to push their engine to Mobile for a while. I get that it's new territory for the Unreal Engine, but it just seems like a big oversight when you think about it.

                          Comment


                            #14
                            Hello Vipar,

                            If you are looking for a simple button click and hold that you can apply to the screen I have an example that you can try. This example may be viable depending on your needs, if I understood what it was that you are looking for. I hope that this information helps.

                            Example:

                            I have created a new widget blueprint and I have simply added a button to the designer tab. I then created an OnPressed and an OnReleased event for this button. From there I used a gate to open and close a loop that runs as long as the button is held down. The print string in the example is where you would run the desired function. The delay can be altered to fine tune how quickly you would like the button to repeatedly fire off while the button is down.

                            Click image for larger version

Name:	ButtonHoldHelp.png
Views:	1
Size:	80.0 KB
ID:	1082256

                            Make it a great day

                            Comment


                              #15
                              Originally posted by Rudy Triplett View Post
                              Hello Vipar,

                              If you are looking for a simple button click and hold that you can apply to the screen I have an example that you can try. This example may be viable depending on your needs, if I understood what it was that you are looking for. I hope that this information helps.

                              Example:

                              I have created a new widget blueprint and I have simply added a button to the designer tab. I then created an OnPressed and an OnReleased event for this button. From there I used a gate to open and close a loop that runs as long as the button is held down. The print string in the example is where you would run the desired function. The delay can be altered to fine tune how quickly you would like the button to repeatedly fire off while the button is down.

                              [ATTACH=CONFIG]49133[/ATTACH]

                              Make it a great day
                              I will give this a try and report back. When I tried to do something similar myself I ran into infinite loop errors.

                              Comment

                              Working...
                              X