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

Character3D capsule collisionShape3D getting stuck in trimesh heightmap planes #69131

Closed
StoreBoughtRocketGames opened this issue Nov 24, 2022 · 7 comments

Comments

@StoreBoughtRocketGames
Copy link

StoreBoughtRocketGames commented Nov 24, 2022

Godot version

4.0 dev Beta 6

System information

Windows 10, Vulkin

Issue description

My Character3D player is getting stuck on trimesh collision surfaces, basically anything that isn't a flat trimesh plane. I tried to make a heightmap in Blender, and trimesh the surface to use as a landscape, and found it was basically unusable.

It happens with capsule shapes, and (I believe, but need to confirm) also happens with cylinder shape collisions, but seems to be not happening at all for boxShape collisions. I almost can't move at all when I use a capsule collision shape. There may be some relation to issue #46712, but this seemed different enough to warrant a new bug report. I searched for this issue, and couldn't find anything, so hopefully I'm not duplicating a known issue.

Steps to reproduce

Run around terrain (ASDW), and you should get stuck almost right away. To get unstuck, you can push spacebar to jump, which you can use to move around the level. Change to a boxShape, and the issue goes away. I think the issue is also present to some extent with the cylinder collision shape, but it happens less frequently.

Minimal reproduction project

TestProject.zip

@StoreBoughtRocketGames StoreBoughtRocketGames changed the title Character3D cylinder collisionShape3D getting stuck in trimesh heightmap planes Character3D capsule collisionShape3D getting stuck in trimesh heightmap planes Nov 24, 2022
@StoreBoughtRocketGames
Copy link
Author

StoreBoughtRocketGames commented Nov 25, 2022

This doesn't occur in Godot 3.5.1. So, most likely a Godot 4.0 only issue. I'm able to run around in the same scene just fine. Although, I get the capsule collision clipping through the terrain, it doesn't get stuck. So there is some weirdness with the capsule collision in 3.5.1., but it doesn't make it unplayable.

Minimal reproduction project

TestProject_3_5.zip

@snougo
Copy link

snougo commented Nov 25, 2022

I got same issue and it caused by ConcavePolygonShape3D, when I used ConvexPolygonShape3D, there is not such problem at all.

Screen.Recording.2022-11-25.at.5.47.42.PM.mov
Screen.Recording.2022-11-25.at.5.48.04.PM.mov

@Gamepro5
Copy link
Contributor

This seems to be due to the same underlying issue as #69137

It seems to be a tracked issue, but hasn't been fixed yet despite it's severity. I suspect that the the issue of trimesh edges causing incorrect collision normals causes

#46712
#69131
#69137

There are probably more I'm missing.

@StoreBoughtRocketGames
Copy link
Author

StoreBoughtRocketGames commented Nov 25, 2022

Any idea why the behavior is different from 3.5.1 to 4.0? I haven't looked through engine code myself as I'm not familiar. But, I'm fairly certain someone could figure out how to fix it if they compared the code from 3.5.1 to this one. Probably not a good use of my time personally since I've never contributed, nor compiled the engine.

Not sure if you want to leave this issue open or not since there do appear to be other reports out there if the same thing. The only new info this one has is the behavior difference from 3.5.1 to now. I'd be fine if you wanted to close it out as a duplicate.

@josheb
Copy link

josheb commented Dec 3, 2022

I'm seeing this sometimes with a capsule shape. The FPS template in the repository is my starting point.
godot_physics_1.webm
Axis alignment seems to be a factor. If I run straight at it it will stick much of the time, but if I rotate a little it slides past.

@akien-mga akien-mga added this to the 4.0 milestone Dec 19, 2022
@akien-mga akien-mga moved this to To Assess in 4.x Priority Issues Dec 19, 2022
@rburing
Copy link
Member

rburing commented Dec 19, 2022

Related to (or maybe even the same as) #69683.

@rburing
Copy link
Member

rburing commented Jan 25, 2023

The main problem in the minimal reproduction project is the non-uniformly scaled capsule collision shape on the character. Since 4.0 beta 15 the editor (and the class reference) warns against using non-uniform scaling for 3D physics objects (see #67847), since such transformations can't be supported properly by the physics engine.

Using a capsule collision shape with uniform (1, 1, 1) scale (and the radius and height updated to approximately match the previous transformed shape) fixes the issue: TestProject-uniformscale.zip.

@rburing rburing closed this as completed Jan 25, 2023
@github-project-automation github-project-automation bot moved this from To Assess to Done in 4.x Priority Issues Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

6 participants