godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.95k stars 3.22k forks source link

Incorrect PhysicsShapeQueryParameters2D C# examples on the ray-casting documentation page #9997

Closed lpszmoths closed 1 month ago

lpszmoths commented 1 month ago

Your Godot version: 4.3

Issue description: The C# examples include the following lines:

var query = PhysicsRayQueryParameters2D.Create(Vector2.Zero, new Vector2(50, 100));
var query = PhysicsRayQueryParameters2D.Create(globalPosition, playerPosition);

This doesn't work. It results in the following error:

'PhysicsShapeQueryParameters2D' does not contain a definition for 'Create' (CS0117)

To my knowledge, there's no way to initialize a PhysicsShapeQueryParameters2D with a specific position in C# either.

URL to the documentation page: https://docs.godotengine.org/en/stable/tutorials/physics/ray-casting.html

If you know how to fix the issue you are reporting please consider opening a pull request. We provide a tutorial on using git here: https://docs.godotengine.org/en/stable/community/contributing/pr_workflow.html, writing documentation at https://docs.godotengine.org/en/stable/community/contributing/docs_writing_guidelines.html and contributing to the class reference here: https://docs.godotengine.org/en/stable/community/contributing/updating_the_class_reference.html

lpszmoths commented 1 month ago

My apologies, I just reread my question and it turns out I was using PhysicsShapeQuery rather than PhysicsRayQuery. Closing.