Special Jump help
RondoRocket
Member Posts: 411
I am having a problem with a special type of jump I'm putting together. When the jump button is pressed I want the actor to jump for either a period of time, like 2 seconds, or until the button is released. This rule works fine, the problem I'm having is that I have to use OnRelease if the player decides to stop jumping before the timer expires. If the button OnRelease is applied to is swiped rather than pressed it executes the jump sequence automatically. It seems like a bug, but I actually think it has to do with being able to cancel out of pressing the button.
Not sure I explained this clearly enough or if anyone has a work around, but suggestions would be appreciated. It's been tormenting me for a while now.
Thanks!
Not sure I explained this clearly enough or if anyone has a work around, but suggestions would be appreciated. It's been tormenting me for a while now.
Thanks!
Twitter:rondorocket
Web: rondorocket.com
Comments
In your button actor create a Boolean attribute called touchpressed
Then in a rule
When touch is pressed
--Change Attribute self.touchpressed to true
Otherwise
--Change Attribute self.touchpressed to false
Then instead of using when touch is pressed in all of your rules base it off of self.touchpressed being true or false.
Touch releases once triggers seems to constantly run in my experience
That's exactly my problem with touch releases, they seem to constantly run. At first I thought it was a bug, but I think it's setup to allow for people to cancel out of their selection by sliding their finger off the button if they are in a menu screen. Adding a timer to a touch release seems to only make matters worse.
I will try your suggestion when I get home!
Twitter:rondorocket
Web: rondorocket.com
when touchPressed=true
(timer)
for 2 seconds
change acceleration 90 degrees speed 120 (or whatever)
as long as you leave "run to completion unchecked", this should work, if you hold it down, he will move for two seconds, if you release early, it should exit the function early.
in theory anyways, i didn't actually test it
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left