Rotate player
This commit is contained in:
@@ -48,6 +48,8 @@ func _applyPlayerMovement(_delta:float):
|
||||
if directionAdjusted.length() <= 0.01:
|
||||
return
|
||||
|
||||
entity.look_at(entity.global_position + directionAdjusted, Vector3.UP)
|
||||
|
||||
var speed = walkSpeed
|
||||
entity.velocity.x = directionAdjusted.x * speed
|
||||
entity.velocity.z = directionAdjusted.z * speed
|
||||
@@ -64,6 +66,8 @@ func _applyFriction(delta:float) -> void:
|
||||
entity.velocity.z *= delta * FRICTION
|
||||
|
||||
func _canMove() -> bool:
|
||||
if UI.dialogueActive:
|
||||
return false
|
||||
if !UI.TEXTBOX.isClosed:
|
||||
return false
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user