interpolate to position loop

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...

Best Answer

Answers

  • SocksSocks London, UK.Member Posts: 12,822

    What happens when the key is released ?

  • jsorr2jsorr2 Member Posts: 279

    @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

  • SocksSocks London, UK.Member Posts: 12,822

    I meant what you like to have happen when you release the key ?

  • jsorr2jsorr2 Member Posts: 279

    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.

  • jsorr2jsorr2 Member Posts: 279

    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 :smile:

  • SocksSocks London, UK.Member Posts: 12,822
    edited November 2014

    ...

  • jsorr2jsorr2 Member Posts: 279

    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.

Sign In or Register to comment.