From 468ff36f4d55caf9b9dfc00be36a0a1cd5aeedb5 Mon Sep 17 00:00:00 2001 From: Zakarya Date: Tue, 28 May 2024 20:21:53 -0700 Subject: [PATCH] Gravity is now toggleable --- addons/fpc/character.gd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/fpc/character.gd b/addons/fpc/character.gd index 738783c..760895d 100644 --- a/addons/fpc/character.gd +++ b/addons/fpc/character.gd @@ -57,6 +57,8 @@ extends CharacterBody3D @export var view_bobbing : bool = true @export var jump_animation : bool = true @export var pausing_enabled : bool = true +@export var gravity_enabled : bool = true + # Member variables var speed : float = base_speed @@ -139,7 +141,7 @@ func _physics_process(delta): # Gravity #gravity = ProjectSettings.get_setting("physics/3d/default_gravity") # If the gravity changes during your game, uncomment this code - if not is_on_floor(): + if not is_on_floor() and gravity and gravity_enabled: velocity.y -= gravity * delta handle_jumping()