Rotate player
This commit is contained in:
@@ -12,6 +12,7 @@ static func dialogueCallable(params:Dictionary) -> int:
|
|||||||
var title:String = params.get('title', 'start')
|
var title:String = params.get('title', 'start')
|
||||||
var extraStates:Array = params.get('extraStates', [])
|
var extraStates:Array = params.get('extraStates', [])
|
||||||
|
|
||||||
|
UI.dialogueActive = true
|
||||||
var line:DialogueLine = await DialogueManager.get_next_dialogue_line(resource, title, extraStates)
|
var line:DialogueLine = await DialogueManager.get_next_dialogue_line(resource, title, extraStates)
|
||||||
while line != null:
|
while line != null:
|
||||||
var text:String = line.text
|
var text:String = line.text
|
||||||
@@ -32,6 +33,7 @@ static func dialogueCallable(params:Dictionary) -> int:
|
|||||||
await UI.TEXTBOX.setTextAndWait(text)
|
await UI.TEXTBOX.setTextAndWait(text)
|
||||||
line = await DialogueManager.get_next_dialogue_line(resource, line.next_id, extraStates)
|
line = await DialogueManager.get_next_dialogue_line(resource, line.next_id, extraStates)
|
||||||
|
|
||||||
|
UI.dialogueActive = false
|
||||||
return Cutscene.CUTSCENE_CONTINUE
|
return Cutscene.CUTSCENE_CONTINUE
|
||||||
|
|
||||||
static func getDialogueCallable(resource:DialogueResource, title:String = 'start', extraStates:Array = []) -> Dictionary:
|
static func getDialogueCallable(resource:DialogueResource, title:String = 'start', extraStates:Array = []) -> Dictionary:
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ mesh = SubResource("CapsuleMesh_sfgsm")
|
|||||||
surface_material_override/0 = SubResource("StandardMaterial3D_8e8ef")
|
surface_material_override/0 = SubResource("StandardMaterial3D_8e8ef")
|
||||||
|
|
||||||
[node name="Nose" type="Node3D" parent="."]
|
[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"]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="Nose"]
|
||||||
mesh = SubResource("BoxMesh_8e8ef")
|
mesh = SubResource("BoxMesh_8e8ef")
|
||||||
@@ -58,7 +58,7 @@ script = ExtResource("3_bhm0o")
|
|||||||
entity = NodePath("..")
|
entity = NodePath("..")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="EntityInteractingArea"]
|
[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")
|
shape = SubResource("BoxShape3D_sfgsm")
|
||||||
|
|
||||||
[node name="EntityInteractableArea" type="Area3D" parent="." node_paths=PackedStringArray("entity")]
|
[node name="EntityInteractableArea" type="Area3D" parent="." node_paths=PackedStringArray("entity")]
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ func _applyPlayerMovement(_delta:float):
|
|||||||
if directionAdjusted.length() <= 0.01:
|
if directionAdjusted.length() <= 0.01:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
entity.look_at(entity.global_position + directionAdjusted, Vector3.UP)
|
||||||
|
|
||||||
var speed = walkSpeed
|
var speed = walkSpeed
|
||||||
entity.velocity.x = directionAdjusted.x * speed
|
entity.velocity.x = directionAdjusted.x * speed
|
||||||
entity.velocity.z = directionAdjusted.z * speed
|
entity.velocity.z = directionAdjusted.z * speed
|
||||||
@@ -64,6 +66,8 @@ func _applyFriction(delta:float) -> void:
|
|||||||
entity.velocity.z *= delta * FRICTION
|
entity.velocity.z *= delta * FRICTION
|
||||||
|
|
||||||
func _canMove() -> bool:
|
func _canMove() -> bool:
|
||||||
|
if UI.dialogueActive:
|
||||||
|
return false
|
||||||
if !UI.TEXTBOX.isClosed:
|
if !UI.TEXTBOX.isClosed:
|
||||||
return false
|
return false
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ extends Node
|
|||||||
|
|
||||||
var rootUi:RootUI = null
|
var rootUi:RootUI = null
|
||||||
|
|
||||||
|
# True for the entire duration of a DialogueAction run, including the frames
|
||||||
|
# between lines where the textbox is momentarily closed.
|
||||||
|
var dialogueActive:bool = false
|
||||||
|
|
||||||
var DEBUG_MENU:
|
var DEBUG_MENU:
|
||||||
get():
|
get():
|
||||||
if rootUi && rootUi.debugMenu:
|
if rootUi && rootUi.debugMenu:
|
||||||
|
|||||||
Reference in New Issue
Block a user