hyperPad hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    How can I make a smooth d-pad

    Scheduled Pinned Locked Moved
    Help and Support
    9
    71
    6.2k
    Loading More Posts
    • 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.
    • TutorialDoctorT
      TutorialDoctor
      last edited by 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 1 Reply Last reply Reply Quote 0
      • iTap DevelopmentI
        iTap Development @TutorialDoctor
        last edited by

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

        1 Reply Last reply Reply Quote 0
        • Aidan_FireA
          Aidan_Fire
          last edited by

          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 Reply Quote 0
          • Aidan_FireA
            Aidan_Fire
            last edited by

            This works
            0_1493243077664_IMG_3521.PNG

            iTap DevelopmentI Jack8680J 2 Replies Last reply Reply Quote 0
            • iTap DevelopmentI
              iTap Development @Aidan_Fire
              last edited by iTap Development

              @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.

              Jack8680J 1 Reply Last reply Reply Quote 0
              • Jack8680J
                Jack8680 @Aidan_Fire
                last edited by

                @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 Reply Quote 0
                • Jack8680J
                  Jack8680 @iTap Development
                  last edited by

                  @Stephenn This should work:
                  0_1493250473832_IMG_3207.PNG

                  iTap DevelopmentI 1 Reply Last reply Reply Quote 0
                  • iTap DevelopmentI
                    iTap Development @Jack8680
                    last edited by

                    @Jack8680 that is what I was trying to say to do, and probably failed lol 😂. I didn't think of what you did for the joystick down, but that's a good way to do it!

                    1 Reply Last reply Reply Quote 0
                    • S
                      Stephenn
                      last edited by

                      Ok thanks for the help everyone.

                      1 Reply Last reply Reply Quote 0
                      • S
                        Stephenn
                        last edited by

                        Ok so I have my joystick 0_1493289167232_IMG_1321.PNG if I walk into an object I kind of squish into it can someone tell me how to fix this?

                        iTap DevelopmentI 1 Reply Last reply Reply Quote 0
                        • iTap DevelopmentI
                          iTap Development @Stephenn
                          last edited by

                          @Stephenn you could do this. Put the move behaviors in the "behavior off"'s and have each of the collided behaviors have one direction (up down left or right) selected. Now since the "stopped colliding" behavior doesn't have directions, you can just turn the move behaviors back on when the joystick moves in the opposite direction, since that would move it away from the object you hit.0_1493290353899_IMG_1866.PNG

                          @Murtaza why doesn't the stopped colliding have directions?

                          Aidan_FireA 1 Reply Last reply Reply Quote 0
                          • Aidan_FireA
                            Aidan_Fire @iTap Development
                            last edited by Aidan_Fire

                            I checked the screenshot I sent you, played the project and it works, there is no diagonal movement. Try it. @Jack8680 yeah but no one will notice it lol. Well I sort of do, but I don't really care, doesn't affect it in any major way.

                            1 Reply Last reply Reply Quote 0
                            • S
                              Stephenn
                              last edited by

                              Ok thanks

                              1 Reply Last reply Reply Quote 0
                              • S
                                Stephenn
                                last edited by

                                @Aidan-Oxley, or anyone, how did you change the value of the box container?

                                iTap DevelopmentI 1 Reply Last reply Reply Quote 0
                                • iTap DevelopmentI
                                  iTap Development @Stephenn
                                  last edited by

                                  @Stephenn, any behavior output you put in the box container will set the value of the box container when the behavior runs . And you can drag as many outputs in a box container that you need.

                                  1 Reply Last reply Reply Quote 0
                                  • Aidan_FireA
                                    Aidan_Fire
                                    last edited by

                                    0_1493336261810_IMG_3523.PNG
                                    Press on the box container, then press on the symbol to the left of the default value.

                                    iTap DevelopmentI 1 Reply Last reply Reply Quote 0
                                    • iTap DevelopmentI
                                      iTap Development @Aidan_Fire
                                      last edited by

                                      @Aidan-Oxley I think this will work better, because with what you did you have to use the extra "set input field" behavior. For mine, When one of the add value's is triggered it will set the box container to its output automatically.0_1493340437316_IMG_1870.PNG

                                      Aidan_FireA 1 Reply Last reply Reply Quote 0
                                      • Aidan_FireA
                                        Aidan_Fire @iTap Development
                                        last edited by Aidan_Fire

                                        @iTap-Development Yeah I'm still not used to that, I'm still stuck in the old way of using box containers lol before they let you have multiple storages.

                                        iTap DevelopmentI TutorialDoctorT 2 Replies Last reply Reply Quote 1
                                        • S
                                          Stephenn
                                          last edited by

                                          Ok thanks

                                          1 Reply Last reply Reply Quote 0
                                          • iTap DevelopmentI
                                            iTap Development @Aidan_Fire
                                            last edited by

                                            @Aidan-Oxley yeah I found it out by trying to put an output in the default value input field, and when it move up to its own input field I tried again and found you could do multiple. Lol

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post