Stop the jittery motion of the circles.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By THE HELIX

The circles in the project are from above and collect at the bottom.When at rest there is a jittery motion. How can I implement a physics behaviour when the circles collide; Such that the circles stop moving if they are too close to one another and start moving again if there is free space around them.
I think that the jittery motion must be attributed to the fact that the circles keep their initial velocity after they have piled up. Can anyone tell me how to stop this jittery motion and fill the free space around them ?
[Here is the project Project ]

can u rephrase your question please, I’ve checked the project and what i see is :

circle spawns → circle goes down → circle stops when hit the ground

I dont see any jittery motion when the circles are in free-fall,

but I see the circles sliding after they stop, is that what you mean ?

Xtremezero | 2020-01-08 17:15

When the circles come to rest after sometime you can see the line attached to it starts shaking. Is there any way to stop it ?

THE HELIX | 2020-01-08 17:58

oh got you, one of the solutions can be checking if the velocity of the circles became too close to zero, then you stop the (move and slide) function from execution … to do that you simply need to use the return value of the move_and_slide() function

if can_move:
      var New_Velocity = move_and_slide ( params )
      if New_Velocity.length() < 0.01 :
            can_move = false

I hope this fixes it

Xtremezero | 2020-01-08 18:16