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

[GodotPhysics] CharacterBody3D gets stuck on flat ends of static cylinders #57476

Open
Kalcen opened this issue Jan 31, 2022 · 16 comments · Fixed by #70787
Open

[GodotPhysics] CharacterBody3D gets stuck on flat ends of static cylinders #57476

Kalcen opened this issue Jan 31, 2022 · 16 comments · Fixed by #70787

Comments

@Kalcen
Copy link

Kalcen commented Jan 31, 2022


Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.


Godot version

4.0

System information

Windows 10

Issue description

Moving a CharacterBody3D along the flat end of a cylinder does not behave the same as sliding along a flat wall. The CharacterBody3D can even become stuck in place and unable to move away form the cylinder once it reaches the edges of the cylinder's flat surface
CylinderIssue
.

Steps to reproduce

  • Place a CharacterBody3D on a flat surface
  • Place a cylindrical StaticBody3D collider near the CharacterBody3D, and rotate it 90° along the X axis so the bottom or top of the cylinder becomes a wall.
  • In play mode move the character so that it collides with the flat end of the cylinder, and try to slide along it diagonally like a wall.

(For some reason if the cylinder has its scale set to (2.8, 2, 2.8) and is placed about 1 unit above the surface of the floor the issue is more present)

Minimal reproduction project

CharacterAndCylinderIssue.zip

@Chaosus Chaosus added this to the 4.0 milestone Jan 31, 2022
@Kalcen
Copy link
Author

Kalcen commented Feb 6, 2022

I noticed that this problem doesn't occur if the collider is a polygonal cylinder, like with a CSG cylinder.

@fabriceci
Copy link
Contributor

The problem is related to the contact points returned by the engine, it seems to occur only with this rotation, this could be caused by a bad separation axis.

In the following image you can see the contact points as pink dots::

test1

Same scene but using a CSG Cylinder:

test2

As in the first one, there is no contact point in the cylinder, the body cannot slide and ends up being stuck.

@novaplusplus
Copy link
Contributor

I believe I am encountering something similar but with more than just cylinders, I've been getting it with all collision shapes. Sliding against them just seems very failure-prone and leads to objects getting stuck all the time.

@fabriceci
Copy link
Contributor

@novaplusplus could you share a minimal reproduction project, just the bare minimum with the default script movement?

@prominentdetail
Copy link
Contributor

I am having similar problem..
stuckwall
@fabriceci Here is a minimal reproduction with default script movement:
moveSlideStuck.zip

@Calinou Calinou changed the title CharacterBody3D gets stuck on flat ends of static cylinders [GodotPhysics] CharacterBody3D gets stuck on flat ends of static cylinders Dec 21, 2022
@Ldi2dier
Copy link

Ldi2dier commented Jan 5, 2023

I believe I am encountering something similar but with more than just cylinders, I've been getting it with all collision shapes. Sliding against them just seems very failure-prone and leads to objects getting stuck all the time.

Same thing is happening to me. Brush up against a wall? Stuck.

@Dan2552
Copy link

Dan2552 commented Apr 16, 2023

@akien-mga was this closed intentionally? I'm still seeing CharacterBody3D getting stuck agaisn't edges on 4.0.2, including on the above example by prominentdetail

@Calinou
Copy link
Member

Calinou commented Apr 16, 2023

I can confirm the issue still occurs with @prominentdetail's MRP in 4.0.2. I would recommend testing #68958 locally and see if it resolves the issue.

@Calinou Calinou reopened this Apr 16, 2023
@Calinou Calinou modified the milestones: 4.0, 4.1 Apr 16, 2023
@Dan2552
Copy link

Dan2552 commented Apr 16, 2023

Unfortunately still able to reproduce on #68958 (v4.0.beta.custom_build [b812101])

You're able to get stuck on the corner here pretty easily
image

@YuriSizov YuriSizov modified the milestones: 4.1, 4.2 Jun 23, 2023
@psychicgoldfish
Copy link

psychicgoldfish commented Jul 17, 2023

having this issue on 4.1. both cylinder and capsule playershapes get stuck on walls and corners of staticbody3ds.
edit: it has no problem sliding against csgboxes normally, but corners still get stuck and jittery

@Dan2552
Copy link

Dan2552 commented Sep 16, 2023

Confirmed still issue in 4.1.1

As far as I can tell so far, this issue doesn't appear to be reproducible when using godot-jolt physics 🤞 . cc godotengine/godot-proposals#7308

@AttackButton
Copy link
Contributor

I tested @prominentdetail's MRP in v4.1.1.stable.official [bd6af8e] with godot-jolt physics and it's working flawlessly.

@YuriSizov YuriSizov removed this from the 4.2 milestone Nov 15, 2023
@YuriSizov YuriSizov added this to the 4.x milestone Nov 15, 2023
@cscooper
Copy link

I have this problem with the characterbody3d node as well. But my set up does not involve walls. It simply gets stuck moving on a flat surface. I'm using the Kenney Starter Kit for 3D Platformers (https://github.com/KenneyNL/Starter-Kit-3D-Platformer), which includes a platform prefab that I'm using with my own characters made from scratch. I can dislodge my character by jumping. However, I'm not sure how to resolve the problem.

I actually think timing might have something to do with it. It seems to happen after 17 seconds of game play. I will move my character back and forth over the platform, and every 17 seconds, it will get caught on the floor, and I have to jump to dislodge it.

I have attached a video of this happening:

godot.s.weird.bug.mp4

Is it possible that it is my computer?

@Yarwin
Copy link

Yarwin commented Jul 16, 2024

I'm still getting bodies with cylinder as collision shapes stuck while sliding against the wall on v4.3.beta3.official [82cedc8].

@KoBeWi KoBeWi removed this from the 4.3 milestone Aug 3, 2024
@wapcaf
Copy link

wapcaf commented Feb 15, 2025

Image

I am also experiencing this, when trying to move when there is a edge just clipping the top of the capsule collider my player controller uses. The CharacterBody3D does not slide, it gets stuck.

@Calinou
Copy link
Member

Calinou commented Feb 18, 2025

@wapcaf This should be resolved in 4.4.beta if you switch the 3D physics engine to Jolt Physics in the Project Settings. If not, please open a new issue with a minimal reproduction project attached.

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.