Refactoring
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class_name EntityMovement extends Node
|
||||
|
||||
const GRAVITY = Vector3.DOWN * 100
|
||||
const FRICTION = 0.01
|
||||
const WALK_SPEED_DEFAULT = 8
|
||||
const RUN_SPEED_DEFAULT = 12
|
||||
@@ -18,7 +19,7 @@ const RUN_SPEED_DEFAULT = 12
|
||||
#
|
||||
func _applyGravity() -> void:
|
||||
if !entity.is_on_floor():
|
||||
entity.velocity += PHYSICS.GRAVITY * get_process_delta_time()
|
||||
entity.velocity += GRAVITY * get_process_delta_time()
|
||||
|
||||
func _applyPlayerMovement(_delta:float):
|
||||
if Input.is_action_just_pressed("interact") && interactingArea && interactingArea.hasInteraction():
|
||||
|
||||
Reference in New Issue
Block a user