Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2D PhysicsMaterial bounce > 0, constantly agitated/vibrating when they should be at rest #25186

Closed
Tracked by #45334
twilson90 opened this issue Jan 21, 2019 · 3 comments · Fixed by #55313
Closed
Tracked by #45334

Comments

@twilson90
Copy link

Godot version:
3.1.beta2.mono.official

Issue description:
If you place lots of objects in a physics environment with >0 bounce, they vibrate and never fully come to rest.
I think setting the gravity higher makes it even worse.

You can see this demonstrated in the 'Scene Instancing Demo' from the official demos repo (misc/instancing).
It doesn't make sense that a ball with <1 bounce never comes to rest, there must be some strange and unnecessary impulse being applied behind the scenes.

@twilson90 twilson90 changed the title 2D PhysicsMaterial bounce > 0 = constantly agitated, vibrating when they should be at rest 2D PhysicsMaterial bounce > 0, constantly agitated/vibrating when they should be at rest Jan 21, 2019
@ghost
Copy link

ghost commented Jan 21, 2019

I was having the same problem: #24332

49969120-69013500-ff30-11e8-9094-68d7d217dcfe

@gianlluca
Copy link
Contributor

Same problem here.

@hirsimaki-markus
Copy link

I have found a somewhat reliable workaround for this. The ball in below game can only jump if its colliding e.g. not agitated.

quantum-yeet

I confirmed it to work with high weights like 100. Values like weight and bounciness might require tweaking along with the threshold below but this should stop infinite bouncing:

func _physics_process(delta):
	if abs(linear_velocity.y) <= 100:
		physics_material_override.absorbent = 1
	else:
		physics_material_override.absorbent = 0

I have no idea how to contribute to the source but I suppose the above logic could be implemented directly into source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants