Merge pull request #81967 from Jordyfel/physics-doc

Fix example in gravity project settings doc
This commit is contained in:
Rémi Verschelde 2023-09-20 18:55:21 +02:00
commit 0c71c7cc6f
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -2117,11 +2117,11 @@
[codeblocks] [codeblocks]
[gdscript] [gdscript]
# Set the default gravity strength to 9.8. # Set the default gravity strength to 9.8.
PhysicsServer3D.area_set_param(get_viewport().find_world().space, PhysicsServer3D.AREA_PARAM_GRAVITY, 9.8) PhysicsServer3D.area_set_param(get_viewport().find_world_3d().space, PhysicsServer3D.AREA_PARAM_GRAVITY, 9.8)
[/gdscript] [/gdscript]
[csharp] [csharp]
// Set the default gravity strength to 9.8. // Set the default gravity strength to 9.8.
PhysicsServer3D.AreaSetParam(GetViewport().FindWorld().Space, PhysicsServer3D.AreaParameter.Gravity, 9.8); PhysicsServer3D.AreaSetParam(GetViewport().FindWorld3D().Space, PhysicsServer3D.AreaParameter.Gravity, 9.8);
[/csharp] [/csharp]
[/codeblocks] [/codeblocks]
</member> </member>
@ -2131,11 +2131,11 @@
[codeblocks] [codeblocks]
[gdscript] [gdscript]
# Set the default gravity direction to `Vector3(0, -1, 0)`. # Set the default gravity direction to `Vector3(0, -1, 0)`.
PhysicsServer3D.area_set_param(get_viewport().find_world().get_space(), PhysicsServer3D.AREA_PARAM_GRAVITY_VECTOR, Vector3.DOWN) PhysicsServer3D.area_set_param(get_viewport().find_world_3d().space, PhysicsServer3D.AREA_PARAM_GRAVITY_VECTOR, Vector3.DOWN)
[/gdscript] [/gdscript]
[csharp] [csharp]
// Set the default gravity direction to `Vector3(0, -1, 0)`. // Set the default gravity direction to `Vector3(0, -1, 0)`.
PhysicsServer3D.AreaSetParam(GetViewport().FindWorld().Space, PhysicsServer3D.AreaParameter.GravityVector, Vector3.Down) PhysicsServer3D.AreaSetParam(GetViewport().FindWorld3D().Space, PhysicsServer3D.AreaParameter.GravityVector, Vector3.Down)
[/csharp] [/csharp]
[/codeblocks] [/codeblocks]
</member> </member>