interpolate to position loop
jsorr2
Member Posts: 279
Wondering how I can interpolate self.position.x+100 as long as a key is pressed, over and over. so, if it reaches its destination of position.x+100 and key is still pressed, repeat interpolate new.position.x+100.
I can't seem to figure it out...
Answers
What happens when the key is released ?
@Socks Nothing happens. I push the key, it interpolates right+100, then stops. i let go of the key, nothing happens. I push the key again and it moves right+100 again then stops.
Hoping to not have to let go and re-push the key over and over
I meant what you like to have happen when you release the key ?
I want to replace 'move-to' with interpolate. so i want to move an actor over and over while holding down a key. when i release the key, i want it to finish the last interpolate it was assigned and then stop.
wow @Socks you are the man! thanks for that
It's a shame that it has to stop for a bit before moving again as I was hoping for smoothness. I don't know if that's a silly notion though.
either way you rock
...
Like I said I wanted to use it as if it was a move behaviour, except to confine movement to a grid. move-to was good for that until I increased the speed past 150 then it started to bug out. I read a few times on the forums people replaced move-to with interpolate.