Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. How can I make a smooth d-pad

How can I make a smooth d-pad

Scheduled Pinned Locked Moved Help and Support
71 Posts 9 Posters 37.8k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stephenn
    wrote on last edited by
    #1

    I want to make a d-pad that runs smoothly on a no gravity top view

    1 Reply Last reply
    0
    • Aidan_FireA Offline
      Aidan_FireA Offline
      Aidan_Fire
      wrote on last edited by Aidan_Fire
      #2

      Make a birds eye view game, then add joystick controlled behaviour into the object you want to control.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Stephenn
        wrote on last edited by
        #3

        I only want the object to go straight not diagonally

        1 Reply Last reply
        0
        • Aidan_FireA Offline
          Aidan_FireA Offline
          Aidan_Fire
          wrote on last edited by
          #4

          Then use the joystick up, down, left and right behaviours to move, and add a move by or something in them. I haven't made that sort of thing in a while, I believe I did in only one project, Winter Pac-Man.

          Jack de WildeJ 1 Reply Last reply
          0
          • Aidan_FireA Aidan_Fire

            Then use the joystick up, down, left and right behaviours to move, and add a move by or something in them. I haven't made that sort of thing in a while, I believe I did in only one project, Winter Pac-Man.

            Jack de WildeJ Offline
            Jack de WildeJ Offline
            Jack de Wilde
            wrote on last edited by
            #5

            @Aidan-Oxley but then holding diagonally will activate two of the directions.

            iTap DevelopmentI 1 Reply Last reply
            0
            • Jack de WildeJ Jack de Wilde

              @Aidan-Oxley but then holding diagonally will activate two of the directions.

              iTap DevelopmentI Offline
              iTap DevelopmentI Offline
              iTap Development
              wrote on last edited by iTap Development
              #6

              @Jack8680 but you could output the angel of the joystick to make sure it's not diagonal with an "if". Like "if angle is not equal to 45" or something.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Stephenn
                wrote on last edited by
                #7

                Thanks guys I will try this

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Stephenn
                  wrote on last edited by
                  #8

                  I tried the if for angles. It works for 45 and 135 degrees but not 225 or 315 degrees, I think it must be a bug.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    Stephenn
                    wrote on last edited by
                    #9

                    Can someone tell me how to use a photo?

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      Stephenn
                      wrote on last edited by
                      #10

                      I mean a screenshot in the forum

                      1 Reply Last reply
                      0
                      • Aidan_FireA Offline
                        Aidan_FireA Offline
                        Aidan_Fire
                        wrote on last edited by
                        #11

                        How to send a photo? Just press the upload button (cloud with arrow) that should show in the bar above the text box you type your forum post in, then pick your screenshot.

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          Stephenn
                          wrote on last edited by
                          #12

                          Ok thanks, does anyone know why this only moves north-east0_1493206677714_IMG_1319.PNG and this only faces 90 degrees0_1493206763970_IMG_1318.PNG I have changed it from this but it still does weird things

                          TutorialDoctorT iTap DevelopmentI 2 Replies Last reply
                          0
                          • S Stephenn

                            Ok thanks, does anyone know why this only moves north-east0_1493206677714_IMG_1319.PNG and this only faces 90 degrees0_1493206763970_IMG_1318.PNG I have changed it from this but it still does weird things

                            TutorialDoctorT Offline
                            TutorialDoctorT Offline
                            TutorialDoctor
                            wrote on last edited by TutorialDoctor
                            #13

                            @Stephenn If you were to output the joystick controlled angle to a text label, you can see that the angles go from 0 to 180 on the right side and 0 to -180 on the left side. The angle is never 270 degrees. So "If Greater Than 210" is invalid.

                            1 Reply Last reply
                            0
                            • S Stephenn

                              Ok thanks, does anyone know why this only moves north-east0_1493206677714_IMG_1319.PNG and this only faces 90 degrees0_1493206763970_IMG_1318.PNG I have changed it from this but it still does weird things

                              iTap DevelopmentI Offline
                              iTap DevelopmentI Offline
                              iTap Development
                              wrote on last edited by
                              #14

                              @Stephenn how you have that set up isn't going g to work I don't think.... because if the angle is 271, all of those IF's will run, because 271 is greater than 0 and 90 and 180 and 270. (Although only the first two IF's are valid angles)
                              Instead you should use the joystick up, down, left, and right behaviors.
                              So to move right, you would do a joystick right, and an IF to check if the angle is greater than 45, then another IF to check if the angle is less than 135, and then your "move by" behavior.
                              And it would be the same for all the other directions, except(obviously) different numbers in the IF's.
                              also, you might want to have either the UP and DOWN or LEFT and RIGHT IF's be "greater than or equal to" and "less than or equal to" because otherwise the 45, 135, -45, and -135 angles wouldn't trigger ANY movement. But it would HAVE to be either up and down OR left and right.

                              I hope that makes some sense!

                              Also, @TutorialDoctor is right about the angle output. But it is 0 to -180 on the left side.

                              1 Reply Last reply
                              0
                              • TutorialDoctorT Offline
                                TutorialDoctorT Offline
                                TutorialDoctor
                                wrote on last edited by TutorialDoctor
                                #15

                                This looks like something similar to my 3D rotation example:

                                https://forum.hyperpad.com/topic/273/logic-behavior-examples/16

                                The greater thans should work the way he has it but The angle is never greater than 180. I would probably use Greater than 178 or 179 on the right side and less than -178/-179 on the left side. Also, the order of the behaviors seems to matter.

                                iTap DevelopmentI 1 Reply Last reply
                                0
                                • TutorialDoctorT TutorialDoctor

                                  This looks like something similar to my 3D rotation example:

                                  https://forum.hyperpad.com/topic/273/logic-behavior-examples/16

                                  The greater thans should work the way he has it but The angle is never greater than 180. I would probably use Greater than 178 or 179 on the right side and less than -178/-179 on the left side. Also, the order of the behaviors seems to matter.

                                  iTap DevelopmentI Offline
                                  iTap DevelopmentI Offline
                                  iTap Development
                                  wrote on last edited by
                                  #16

                                  @TutorialDoctor I just checked, and both IF's trigger.

                                  1 Reply Last reply
                                  0
                                  • Aidan_FireA Offline
                                    Aidan_FireA Offline
                                    Aidan_Fire
                                    wrote on last edited by
                                    #17

                                    I just used joystick up down left and right in one of my projects, worked fine for me, all I have it doing here is lightning up an arrow in the direction the player would go:0_1493242239371_IMG_3520.PNG

                                    1 Reply Last reply
                                    0
                                    • Aidan_FireA Offline
                                      Aidan_FireA Offline
                                      Aidan_Fire
                                      wrote on last edited by
                                      #18

                                      This works
                                      0_1493243077664_IMG_3521.PNG

                                      iTap DevelopmentI Jack de WildeJ 2 Replies Last reply
                                      0
                                      • Aidan_FireA Aidan_Fire

                                        This works
                                        0_1493243077664_IMG_3521.PNG

                                        iTap DevelopmentI Offline
                                        iTap DevelopmentI Offline
                                        iTap Development
                                        wrote on last edited by iTap Development
                                        #19

                                        @Aidan-Oxley I think the problem was that if you Move the joystick diagonally, it would trigger two directions....like up and right. I actually didn't try it but that's what @Jack8680 said. If you were to get your joystick perfectly at like 45° I'm guessing it would trigger two directions for you.

                                        Also, if you look at @Stephenn's screen shot, his IF's were greater than's not equal's, which is why I said they wouldn't work right. Because some thing like 271 is greater than 270,180,90, and 0, so I think all his IFs would get triggered.

                                        Jack de WildeJ 1 Reply Last reply
                                        0
                                        • Aidan_FireA Aidan_Fire

                                          This works
                                          0_1493243077664_IMG_3521.PNG

                                          Jack de WildeJ Offline
                                          Jack de WildeJ Offline
                                          Jack de Wilde
                                          wrote on last edited by
                                          #20

                                          @Aidan-Oxley moving diagonally activates two of the directions. With the way you have it, one of them gets priority based on which one activates last in the tick. This means that it might for example move up when you actually have it more to the right than up, I think there's about a 15° angle where both behaviours would activate.

                                          1 Reply Last reply
                                          0

                                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                          With your input, this post could be even better 💗

                                          Register Login
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Search