Gravity is now toggleable
This commit is contained in:
@ -57,6 +57,8 @@ extends CharacterBody3D
|
|||||||
@export var view_bobbing : bool = true
|
@export var view_bobbing : bool = true
|
||||||
@export var jump_animation : bool = true
|
@export var jump_animation : bool = true
|
||||||
@export var pausing_enabled : bool = true
|
@export var pausing_enabled : bool = true
|
||||||
|
@export var gravity_enabled : bool = true
|
||||||
|
|
||||||
|
|
||||||
# Member variables
|
# Member variables
|
||||||
var speed : float = base_speed
|
var speed : float = base_speed
|
||||||
@ -139,7 +141,7 @@ func _physics_process(delta):
|
|||||||
|
|
||||||
# Gravity
|
# Gravity
|
||||||
#gravity = ProjectSettings.get_setting("physics/3d/default_gravity") # If the gravity changes during your game, uncomment this code
|
#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
|
velocity.y -= gravity * delta
|
||||||
|
|
||||||
handle_jumping()
|
handle_jumping()
|
||||||
|
Reference in New Issue
Block a user