Rotate player
This commit is contained in:
@@ -38,7 +38,7 @@ mesh = SubResource("CapsuleMesh_sfgsm")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_8e8ef")
|
||||
|
||||
[node name="Nose" type="Node3D" parent="."]
|
||||
transform = Transform3D(0.393905, 0, 0, 0, 0.393905, 0, 0, 0, 0.393905, 0.571181, 0.340915, 0)
|
||||
transform = Transform3D(0.393905, 0, 0, 0, 0.393905, 0, 0, 0, 0.393905, 0, 0.35, -0.5)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Nose"]
|
||||
mesh = SubResource("BoxMesh_8e8ef")
|
||||
@@ -58,7 +58,7 @@ script = ExtResource("3_bhm0o")
|
||||
entity = NodePath("..")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="EntityInteractingArea"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.604726, 0, 0)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.605)
|
||||
shape = SubResource("BoxShape3D_sfgsm")
|
||||
|
||||
[node name="EntityInteractableArea" type="Area3D" parent="." node_paths=PackedStringArray("entity")]
|
||||
|
||||
@@ -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