GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Strength of Jump determined by Button Press Time

I want the actor to jump at a certain power/strength based on the time the jump button is pressed for. I also want the actor to jump only after the button is released. I have been able to get this to work on button press, but not release.

Anyone have any ideas?

Comments

  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    well you would have to time the amount of time the button was held down
    and then run all of your jump rules based on that when touch is released

    It's not my fault I never learned to take responsibility for anything. ;)

  • KenAdamsKenAdams Posts: 4Member
    Thanks, how would I go about timing the button?
  • JarrenHJarrenH Posts: 206Member
    At the moment of the button being pressed, save the actors self.time to an attribute. Then when mouse is released, subtract the saved attribute from the actors self.time. This will give you the length of time the button was held down. It's up to you why to do with it from that point.
  • KenAdamsKenAdams Posts: 4Member
    Ah yes, thank you very much. It seems to have worked
This discussion has been closed.