diff options
author | fabriceci <fabricecipolla@gmail.com> | 2022-02-07 11:46:30 +0100 |
---|---|---|
committer | fabriceci <fabricecipolla@gmail.com> | 2022-02-07 11:46:30 +0100 |
commit | e81ccaf270fa06a7ecc6cbf9aed2a35dee29984c (patch) | |
tree | 712a9a1564ebeab5789e85ca800b2a0cc8155392 /modules | |
parent | 6f425242dcce95ae9993dca017f91e7bab2060d3 (diff) |
rename jump force to jump velocity
Diffstat (limited to 'modules')
4 files changed, 8 insertions, 8 deletions
diff --git a/modules/gdscript/editor_templates/CharacterBody2D/basic_movement.gd b/modules/gdscript/editor_templates/CharacterBody2D/basic_movement.gd index 0824d894c5..edaccae018 100644 --- a/modules/gdscript/editor_templates/CharacterBody2D/basic_movement.gd +++ b/modules/gdscript/editor_templates/CharacterBody2D/basic_movement.gd @@ -3,7 +3,7 @@ extends _BASE_ const SPEED: float = 300.0 -const JUMP_FORCE: float = -400.0 +const JUMP_VELOCITY: float = -400.0 # Get the gravity from the project settings to be synced with RigidDynamicBody nodes. var gravity: int = ProjectSettings.get_setting("physics/2d/default_gravity") @@ -16,7 +16,7 @@ func _physics_process(delta: float) -> void: # Handle Jump. if Input.is_action_just_pressed("ui_accept") and is_on_floor(): - motion_velocity.y = JUMP_FORCE + motion_velocity.y = JUMP_VELOCITY # Get the input direction and handle the movement/deceleration. # As good practice, you should replace UI actions with custom gameplay actions. diff --git a/modules/gdscript/editor_templates/CharacterBody3D/basic_movement.gd b/modules/gdscript/editor_templates/CharacterBody3D/basic_movement.gd index ce6d67ae84..e191e5451a 100644 --- a/modules/gdscript/editor_templates/CharacterBody3D/basic_movement.gd +++ b/modules/gdscript/editor_templates/CharacterBody3D/basic_movement.gd @@ -3,7 +3,7 @@ extends _BASE_ const SPEED: float = 5.0 -const JUMP_FORCE: float = 4.5 +const JUMP_VELOCITY: float = 4.5 # Get the gravity from the project settings to be synced with RigidDynamicBody nodes. var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity") @@ -16,7 +16,7 @@ func _physics_process(delta: float) -> void: # Handle Jump. if Input.is_action_just_pressed("ui_accept") and is_on_floor(): - motion_velocity.y = JUMP_FORCE + motion_velocity.y = JUMP_VELOCITY # Get the input direction and handle the movement/deceleration. # As good practice, you should replace UI actions with custom gameplay actions. diff --git a/modules/mono/editor_templates/CharacterBody2D/basic_movement.cs b/modules/mono/editor_templates/CharacterBody2D/basic_movement.cs index 6e9547ce9b..b0ded3133f 100644 --- a/modules/mono/editor_templates/CharacterBody2D/basic_movement.cs +++ b/modules/mono/editor_templates/CharacterBody2D/basic_movement.cs @@ -6,7 +6,7 @@ using System; public partial class _CLASS_ : _BASE_ { public const float Speed = 300.0f; - public const float JumpForce = -400.0f; + public const float JumpVelocity = -400.0f; // Get the gravity from the project settings to be synced with RigidDynamicBody nodes. public float gravity = (float)ProjectSettings.GetSetting("physics/2d/default_gravity"); @@ -21,7 +21,7 @@ public partial class _CLASS_ : _BASE_ // Handle Jump. if (Input.IsActionJustPressed("ui_accept") && IsOnFloor()) - motionVelocity.y = JumpForce; + motionVelocity.y = JumpVelocity; // Get the input direction and handle the movement/deceleration. // As good practice, you should replace UI actions with custom gameplay actions. diff --git a/modules/mono/editor_templates/CharacterBody3D/basic_movement.cs b/modules/mono/editor_templates/CharacterBody3D/basic_movement.cs index 13be4bbcb1..d8c2f67ac8 100644 --- a/modules/mono/editor_templates/CharacterBody3D/basic_movement.cs +++ b/modules/mono/editor_templates/CharacterBody3D/basic_movement.cs @@ -6,7 +6,7 @@ using System; public partial class _CLASS_ : _BASE_ { public const float Speed = 5.0f; - public const float JumpForce = 4.5f; + public const float JumpVelocity = 4.5f; // Get the gravity from the project settings to be synced with RigidDynamicBody nodes. public float gravity = (float)ProjectSettings.GetSetting("physics/3d/default_gravity"); @@ -21,7 +21,7 @@ public partial class _CLASS_ : _BASE_ // Handle Jump. if (Input.IsActionJustPressed("ui_accept") && IsOnFloor()) - motionVelocity.y = JumpForce; + motionVelocity.y = JumpVelocity; // Get the input direction and handle the movement/deceleration. // As good practice, you should replace UI actions with custom gameplay actions. |