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

    Change Variable based on length of touch?

    Scheduled Pinned Locked Moved
    Help and Support
    3
    7
    539
    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.
    • ThisT
      This
      last edited by

      I have an object set up to play a sfx when the object is touched. Is it possible to set it up so that the longer a finger is on the object, the more the pitch of the sfx changes?

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

        @This you can use while touching with an add values that adds to a box container and the sets it's input field to measure how long the player has been touching, it activates 60 times per second while touching. I don't think you can change the pitch while the sound is being played (as in a transition between low and high pitch), so the usefulness of this depends on what you're trying to do with it.

        ThisT 1 Reply Last reply Reply Quote 0
        • ThisT
          This
          last edited by

          Thank you!

          1 Reply Last reply Reply Quote 0
          • ThisT
            This @Jack8680
            last edited by

            @Jack8680 I'm revisiting this. Trying to have the scale of the object increase the longer you touch it. I've tried to do as you recommended, but haven't cracked it. Wouldn't you be able to post a screen grab?

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

              @This 0_1489729271425_IMG_3152.PNG
              This makes the object scale based on how long you touch it. You can change the box container to change the start size, and you can change the value in add values to control how fast the shape scales. For example, changing the box container to 50 and the add values to 0.833 means it will be at 100% scale after touching for a second. You get weird constants for the add value because it activates 60 times a second.

              1 Reply Last reply Reply Quote 1
              • ThisT
                This
                last edited by

                Awesome! Thanks!

                1 Reply Last reply Reply Quote 0
                • TutorialDoctorT
                  TutorialDoctor
                  last edited by

                  If it activates at 60 times per second, you may want to divide by a constant (60 perhaps) first.

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