Objects wobble when moving with touch

Hello all
I’m creating an event to move a “paddle” left and right with a mobile touch.
When I move it from side to side, the object rattles (wobbles), is there any way to fix it?
Here’s how I’m using the event

When I renumbered the Cursor.X()+5 in the condition to 30, it disappeared.
Does it stabilize as the number goes higher?
I’m wondering what the reason for this is.

I had same issue with i was trying to make move one object with another object for someone

Basically imagine move player 1 with player 2 and vice versa
So they are able to push each other

Idea is
I was checking if player 1 is in collision with player 2
Now if player 1 Xpos is less than player 2 Xpos so it means player 1 is on the left
AND if player 1 have right key pressed
Meaning we want push player 2 by player 1 to the right
And if so i added 3 to player 2 Xpos to move him right

BUT it was choppy
After i switched it to add 5 it was smooth
Idea is
IF player 1 was moving faster than pushing player 2 to the right with change Xpos action (since both players move on their own with platformer behavior)
Then in one frame i was able to invade space of player 2 with space of player 1 (invade his collision mask)

And so instead of adding 3 in one frame to player 2 Xpos it was adding 3TWO TIMES in next frame
Cause moving it 3 pixels to the right was NOT higher than how many pixels player 1 invaded space of player 2

And so it did look choppy
Where changing that to add 3 to add 5 did the trick
Cause it was moving player 2 away enough that for one frame player 1 did not yet reach player 2 collision mask and so it was like smooth movement

I guess if i would go higher than 5 it would be choppy again

BTW you and me this way kinda find how to detect how many pixels per frame our objects are moving

1 Like