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

CharacterBody3D randomly teleports around when moving near the scene origin #77051

Closed
jacobcoughenour opened this issue May 14, 2023 · 2 comments · Fixed by #77171
Closed

CharacterBody3D randomly teleports around when moving near the scene origin #77051

jacobcoughenour opened this issue May 14, 2023 · 2 comments · Fixed by #77171

Comments

@jacobcoughenour
Copy link
Contributor

Godot version

4.1.dev (70f69f6 to ffd32a2)

System information

Windows 11, Intel Core i9-12900K, Forward+, NVIDIA GeForce RTX 2080 SUPER driver v31.0.15.2849

Issue description

When I move the CharacterBody3D with move_and_slide() close to 0,0,0 it sometimes teleports the character. It appears to be teleporting the character to ~25.574m from the origin along the X or Z axis (ex: (0, y, ~25.574) or (~25.574, y ,0)).

Recording.2023-05-13.234934.-.Trim.mp4

(Note: the white cube in the center does not have a collider)

I narrowed it down to PR #76379 introducing this bug since the commit right before it does not exhibit this behavior.

Steps to reproduce

See player.gd in the reproduction project. The gist is I get the input and add it to the velocity with some gravity then call move_and_slide().

The controls are WASD and click the window to cursor lock and rotate left/right.

Minimal reproduction project

repro.zip

@rburing
Copy link
Member

rburing commented May 14, 2023

With Visible Collision Shapes enabled (in the Debug menu) we see that this happens on a seam of a trimesh shape.

The linked PR did change some thresholds (which could be changed back while still keeping the spirit of the PR), but I did not expect this effect. It may be that the changed threshold uncovered some other collision solver bug; this should be investigated further.

@jcostello
Copy link
Contributor

I was experimenting this issue. Good catch

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