@trollingchar Doesnt that mean that i will get a dead spot where the user cant move the player at all?
user4704
@abobakrdy Yes. You generally want that, even if it is just a very small dead zone.
user4704
Otherwise you can, in the general sense, never arrive at the target because you "circle the drain:" on frame N, you're not at the target, so you move and overshoot the target, so on frame N +1 you're not at the target, so you move and overshoot the target, etc.
user4704
And you jitter forever.
user4704
If you can solve that without gameplay ramification by clipping the speed or movement displacement to exactly arrive on the target, you'll usually want a dead zone just to prevent jitter from accidental light mouse movement, etc.
Yeah, lerp didnt make that much difference in this case. However, im far from getting it the way i want: see comparison
user4704
9:17 PM
It's hard to tell from that video, the framerate is a bit low, but it looks like the way the "desired movement" works is by moving the player in the direction indicated by the mouse (perhaps by projecting the mouse position to the ground plane and getting the vector from the character origin to that projected point).
user4704
It looks like there's a dead zone around the player where that won't be true, but also while the mouse is in the dead zone, it doesn't stop the player -- they just keep going in the direction they were going?
user4704
To me that seems most obvious at the very start of the video, where the character is moving up, and the mouse moves slowly down across the character... they keep moving up, but as soon as the mouse gets a certain distance from the character, the character snaps around
Ive been stuck on this for a day, lol. I was using a method which moves the player to a target position, by a specific distance per call. In order to get this desired movement, i had to use a movement method which moves the player in the direction its facing instead. This combined with a dead zone, that only allows the user to navigate if they are above it, takes away the jittery movement. And when the player is inside this dead zone, the player will just keep moving in its direction.
I'm currently busy refactoring timers in my game. Now I store their time in variables and updates decrease it. What's wrong? The approach when there is global time and all timers are assigned once and compared to it seems better to me.