godotengine / godot-docs

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

Ray-casting docs use outdated PhysicsRayQueryParameters constructors #7797

Open Azeler-3 opened 1 year ago

Azeler-3 commented 1 year ago

Your Godot version: 4.1 stable

Issue description: Code snippets in the page use outdated constructors for the PhysicsRayQueryParameters2D and PhysicsRayQueryParameters3D classes.

The query is written as var query = PhysicsRayQueryParameters3D.create(origin, end) when it should be :

var query = PhysicsRayQueryParameters3D.new()
query.from = origin
query.to = end

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

AThousandShips commented 1 year ago

This code is correct, see here, not out of date as this type isn't even available in 3.x