cant call timer multiple times
Posted: Fri Jun 24, 2011 4:59 pm
i hope this isnt too confusing...
what im trying to do:
when a player engages an enemy they "dock" and pivot around a common point, but when the player pushes forwards(w) its rolls a movement attack, like pressing your enemy. if its successful it should push both of you along for a couple of meters. doing this uses some of your "action points", these points are refreshed every 2 seconds. also, your only allowed to do a push attack, once every second.
so far so good:
i have a round counter that flips back and forth between 0 and 1, i also have a toggle switch that gets flipped when you first hit the forwards key during that half-turn(one second). if the round counter and the push toggle arent equal, it wont do the push attack. every time the round counter flips over, it reinitializes the push toggle to an equivalent value. as far as i can tell, this is working just fine.
my problem:
in order to generate the movement Im calling a timer component, and having it do a velocity change everyframe/update. the timer interval and repeat amount get set based off of app.deltatime when you press the key. this also works, but it only works once, and then it quits working.
(it used to work 2 or 3 times, but only in a row, and then it quit working. i changed something while debugging)
ive traced my toggle switches and theyre all doing what they should be.
any ideas?
what im trying to do:
when a player engages an enemy they "dock" and pivot around a common point, but when the player pushes forwards(w) its rolls a movement attack, like pressing your enemy. if its successful it should push both of you along for a couple of meters. doing this uses some of your "action points", these points are refreshed every 2 seconds. also, your only allowed to do a push attack, once every second.
so far so good:
i have a round counter that flips back and forth between 0 and 1, i also have a toggle switch that gets flipped when you first hit the forwards key during that half-turn(one second). if the round counter and the push toggle arent equal, it wont do the push attack. every time the round counter flips over, it reinitializes the push toggle to an equivalent value. as far as i can tell, this is working just fine.
my problem:
in order to generate the movement Im calling a timer component, and having it do a velocity change everyframe/update. the timer interval and repeat amount get set based off of app.deltatime when you press the key. this also works, but it only works once, and then it quits working.
(it used to work 2 or 3 times, but only in a row, and then it quit working. i changed something while debugging)
ive traced my toggle switches and theyre all doing what they should be.
any ideas?