How to make the velocity ZERO of a moving object.

: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 falling from above and collect at the bottom.When at rest they are shaking. 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 shaking must be attributed to the fact that the circles keep their initial velocity after they have piled up. Can anyone tell me how to make them stop shaking and move only when there is free space around them ?
[Here is the project Project ]

I didn’t check your project.

You’re probably talking about RigidBodies? My guess is 2D.

You can set the linear_velocity of a RigidBody to 0 (Vector3()). Ideally, you do this inside the _integrate_forces.handler.

But they’ll still react to physics. (Gravity, Collisions)
You could send them to sleep with sleeping = true. They will, however wake up when they collide with another (non-sleeping) RigidBody.

wombatstampede | 2020-01-16 10:25