Weird movements using interpolate when doing simple movements
revoltandreverb
Member Posts: 159
Hi Guys.
1. When my game begins I want my actor to start at selfposx 20, since the actor is 40px wide.
2. I'm trying to move the actor to a specific location when the right arrow key is pressed repeatedly e.g. press it once it goes to selfpos 60, press it again it goes to selfpos 100, press it again it goes back to selfpos 20.
I tried "move to" but the actor was floating off the screen. I came across a forum post that said to use interpolate instead. I'm using interpolate now, but sometimes the actor stays in one place or moves the opposite direction
Also as far as I can see using 0 for the interpolate duration is not a very smooth animation, it's very jurky, a value of 1 is way to slow. "move to" was perfect with a value of 500.
3. Any way to make the animation not so jurky?
4. How can I make a rule so that when the key is held in, the actor won't move repeatedly to the next location specified, only if you press the key and lift your finger and press again i.e. pressing the key longer than a split second shouldn't make a difference and shouldn't make the actor move.
This is my logic http://grab.by/ux3u
Thanks!
revoltandreverb
1. When my game begins I want my actor to start at selfposx 20, since the actor is 40px wide.
2. I'm trying to move the actor to a specific location when the right arrow key is pressed repeatedly e.g. press it once it goes to selfpos 60, press it again it goes to selfpos 100, press it again it goes back to selfpos 20.
I tried "move to" but the actor was floating off the screen. I came across a forum post that said to use interpolate instead. I'm using interpolate now, but sometimes the actor stays in one place or moves the opposite direction
Also as far as I can see using 0 for the interpolate duration is not a very smooth animation, it's very jurky, a value of 1 is way to slow. "move to" was perfect with a value of 500.
3. Any way to make the animation not so jurky?
4. How can I make a rule so that when the key is held in, the actor won't move repeatedly to the next location specified, only if you press the key and lift your finger and press again i.e. pressing the key longer than a split second shouldn't make a difference and shouldn't make the actor move.
This is my logic http://grab.by/ux3u
Thanks!
revoltandreverb
Comments
Thanks!