Change Variable based on length of touch?
-
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?
-
@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.
-
Thank you!
-
@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?
-
@This
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. -
Awesome! Thanks!
-
If it activates at 60 times per second, you may want to divide by a constant (60 perhaps) first.