summaryrefslogtreecommitdiff
path: root/modules/mono/editor/script_templates/CharacterBody2D
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2022-09-01 00:40:59 +0200
committerRaul Santos <raulsntos@gmail.com>2022-09-01 10:29:52 +0200
commit9a10701c69f073d3d52764c54a1d008475683858 (patch)
tree0374c1cb576b7beeeb45ad40b52ce881bf4e6210 /modules/mono/editor/script_templates/CharacterBody2D
parenta5db03efa724b8910281d73576d31cc662b8cc13 (diff)
C#: Assume 64-bit types when type has no meta
When the C# bindings generator finds a type without meta assume the type refers to the 64-bit version of the type: - `float` is converted to `double` - `int` is converted to `long`
Diffstat (limited to 'modules/mono/editor/script_templates/CharacterBody2D')
-rw-r--r--modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs b/modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs
index 1f5ea7532d..fbad482cf6 100644
--- a/modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs
+++ b/modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs
@@ -11,13 +11,13 @@ public partial class _CLASS_ : _BASE_
// Get the gravity from the project settings to be synced with RigidBody nodes.
public float gravity = ProjectSettings.GetSetting("physics/2d/default_gravity").AsSingle();
- public override void _PhysicsProcess(float delta)
+ public override void _PhysicsProcess(double delta)
{
Vector2 velocity = Velocity;
// Add the gravity.
if (!IsOnFloor())
- velocity.y += gravity * delta;
+ velocity.y += gravity * (float)delta;
// Handle Jump.
if (Input.IsActionJustPressed("ui_accept") && IsOnFloor())