Skip to content

Fix documentation for get_velocity_at_local_position#116106

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
ghsoares:docs-fix-get-velocity-at-local-position
Feb 10, 2026
Merged

Fix documentation for get_velocity_at_local_position#116106
Repiteo merged 1 commit into
godotengine:masterfrom
ghsoares:docs-fix-get-velocity-at-local-position

Conversation

@ghsoares

@ghsoares ghsoares commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Resolves godotengine/godot-docs#7110

There is a misleading description of the expected space of local_position parameter of get_velocity_at_local_position function of both PhysicsDirectBodyState2D and PhysicsDirectBodyState3D classes.

See the docs issue, but briefly, by passing an vector in local space of the body (both translation and rotation), gives incorrect values, by passing an vector in local translation, but global rotation (meaning an offset product of global_point - body.transform.origin) it returns the correct velocity value in global space.

The function has the same behaviour of apply_force for the parameter, expecting an vector in local translation space, but global rotation space.

It's ideal to rename the function to something like get_velocity_at_offset, but this goes outside the scope of this PR and the docs update is more urgent.

@ghsoares ghsoares requested a review from a team as a code owner February 9, 2026 17:45
@akien-mga akien-mga changed the title Fixed documentation for get_velocity_at_local_position Feb 9, 2026
@AThousandShips AThousandShips added this to the 4.x milestone Feb 10, 2026
@AThousandShips AThousandShips requested a review from a team February 10, 2026 09:15
@mihe mihe modified the milestones: 4.x, 4.7 Feb 10, 2026
@Repiteo Repiteo merged commit 49ddb94 into godotengine:master Feb 10, 2026
20 checks passed
@Repiteo

Repiteo commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Thanks! Congratulations on your first merged contribution! 🎉

@ghsoares ghsoares deleted the docs-fix-get-velocity-at-local-position branch February 10, 2026 14:34
rivie13 pushed a commit to rivie13/Phoenix-Agentic-Engine that referenced this pull request Feb 16, 2026
…city-at-local-position

Fix documentation for `get_velocity_at_local_position`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants