godotengine / godotengine/godot

[Physics] RigidBody3D Friction has less effect on spheres

Open
#87,803 4 comments 0 reactions 0 assignees View on GitHub
documentation topic:3d topic:physics
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in : **Godot v4.2.1.stable**, **Godot v4.2.1.stable Mono**, **Godot v4.3.dev2**

### System information

Godot v4.2.1.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Laptop GPU (NVIDIA; 31.0.15.5123) - 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 Threads)

### Issue description

I was doing an experiment with the physics to create some surface resistance to RigidBodies3D using `Physics Materials`, but it seems that the `friction` doesn't work pretty well with spheres. It seems that even with the higher friction, when the sphere RigidBody goes through a surface, its deacceleration is almost zero.

I was hoping to have a the sphere being stopped the moment it touches the surface when `friction = 1` and being slippery as a ice when in a lower values, but maybe I am missing or misunderstood something?

I've tried meshes with bigger resolution both for the surface,the object mesh and collision and the behavior seems to be the same.

With boxes it works better, I think its because all 4 corners of the face are touching the surface?

An example below showing the reaction of the same box and sphere in 3 different friction levels.

- The `0.1` seems to be correct, it's being blocked by the wall but I assume it would go even further.
- The `0.4` seems ok.
- The `1` acts almost the same as `0.4`,with small difference even being more than the double of it.

![sphere_physics](https://github.com/godotengine/godot/assets/54695645/eb130899-ebd9-44f3-9302-a2b314aaa938)

Thank you very much.

### Steps to reproduce

- Create a RigidBody3D with A sphere and a collision. You can add a little of angular and linear damping to help;
- Create a StaticBody with a mesh for the floor ,a collision and add a physics material with `friction=1`;
- Put the Sphere RigidBody3D on top of the floor and add a impulse to it;
- Possibly the sphere will run through the surface like it had almost no friction on it;

### Minimal reproduction project (MRP)

[SphereFriction.zip](https://github.com/godotengine/godot/files/14118995/SphereFriction.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the attached SphereFriction.zip minimal reproduction and reproduce the comparison between sphere and box RigidBody3D contacts using friction values 0.1, 0.4, and 1. Check the behavior across the listed Godot versions and determine whether sphere friction is incorrect or matches the intended physics model; done means the behavior is explained and, if needed, covered by a correction or regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.