Increase the default 2D gravity to 980.0
This makes 2D RigidBody physics feel less floaty out of the box. This closes https://github.com/godotengine/godot-proposals/issues/98.
This commit is contained in:
committed by
Aaron Franke
parent
758bccf364
commit
4a28f7e44f
@@ -1199,17 +1199,17 @@
|
||||
The default angular damp in 2D.
|
||||
[b]Note:[/b] Good values are in the range [code]0[/code] to [code]1[/code]. At value [code]0[/code] objects will keep moving with the same velocity. Values greater than [code]1[/code] will aim to reduce the velocity to [code]0[/code] in less than a second e.g. a value of [code]2[/code] will aim to reduce the velocity to [code]0[/code] in half a second. A value equal to or greater than the physics frame rate ([member ProjectSettings.physics/common/physics_fps], [code]60[/code] by default) will bring the object to a stop in one iteration.
|
||||
</member>
|
||||
<member name="physics/2d/default_gravity" type="int" setter="" getter="" default="98">
|
||||
<member name="physics/2d/default_gravity" type="float" setter="" getter="" default="980.0">
|
||||
The default gravity strength in 2D.
|
||||
[b]Note:[/b] This property is only read when the project starts. To change the default gravity at runtime, use the following code sample:
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
# Set the default gravity strength to 98.
|
||||
PhysicsServer2D.area_set_param(get_viewport().find_world_2d().space, PhysicsServer2D.AREA_PARAM_GRAVITY, 98)
|
||||
# Set the default gravity strength to 980.
|
||||
PhysicsServer2D.area_set_param(get_viewport().find_world_2d().space, PhysicsServer2D.AREA_PARAM_GRAVITY, 980)
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
// Set the default gravity strength to 98.
|
||||
PhysicsServer2D.AreaSetParam(GetViewport().FindWorld2d().Space, PhysicsServer2D.AreaParameter.Gravity, 98);
|
||||
// Set the default gravity strength to 980.
|
||||
PhysicsServer2D.AreaSetParam(GetViewport().FindWorld2d().Space, PhysicsServer2D.AreaParameter.Gravity, 980);
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
</member>
|
||||
|
||||
Reference in New Issue
Block a user