-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
WorldBoundaryShape2D doesn't work when moving a little farther than 11000px away #76917
Comments
Can you reproduce this in 3D? |
…cating boundary every 22000px until the goal See godotengine/godot#76917
Indeed, here is the AABB of the shape: godot/servers/physics_2d/godot_shape_2d.cpp Line 126 in c80a2b4
The same in 3D: godot/servers/physics_3d/godot_shape_3d.cpp Line 148 in c80a2b4
😅 |
Are there any negative consequences to increasing this AABB to much higher values like +1,048,576 (in single precision builds) and ~10 billion (in double precision builds)? Would it make the collision less precise around the plane (i.e. "snapping" to coordinates)? |
It seems odd for WorldBoundaryShape2D to have an AABB, considering it is supposedly "infinite". I suppose it has to in order to be a shape, but ideally there would be some way to make the physics server disregard that and just always test. There will almost never be more than 4 WorldBoundaryShape2D at max, and even for angled ones the collision test is trivial. As is currently, the WorldBoundaryShape2D is somewhat useless for its intended purpose. |
Yeah I stumbled upon the same issue in a side scrolling project on 4.2, it seems that the workaround would be spawning collision shapes every 11k px-ish but not sure how it's sustainable or how the physics server is gonna handle all of that after a while. Then again, like @awardell said it does defeat the purpose of the WorldBoundaryShape2D/3D to have this kind of workaround. PS : Happy holidays !! |
Hit the same issue when working on my game. Is there any plans to make it actually infinite? |
Godot version
v4.0.2.stable.official [7a0977c]
System information
Linux Ubuntu 22.04 with Unity desktop
Issue description
I'm using WorldBoundaryShape2D to delimit my level area and noticed that at some point, the character can leave the delimited area. I identified the collider to stop working around 11000px away from the center of the WorldBoundaryShape2D, in the tangent direction.
The distance is not as crazy as it seems, esp. when working on a runner-style game where the player character moves in the world (and not the reverse, i.e. obstacles are not coming at the player as some shmups do).
If there are technical reasons for the limitation, then this should be documented so users know they must regularly repeat adding the WorldBoundaryShape2D.
Steps to reproduce
Expected: character keeps moving on the ground delimited by WorldBoundaryShape2D
Actual: character falls into the ground shortly after the 11000 milestone
Minimal reproduction project
Godot 4.0.2 - WorldBoundaryShape2D doesn't work when very far.zip
The text was updated successfully, but these errors were encountered: