diff --git a/Cutscenes/prototype_start.tres b/Cutscenes/prototype_start.tres index 1428d55..0ee33d3 100644 --- a/Cutscenes/prototype_start.tres +++ b/Cutscenes/prototype_start.tres @@ -15,6 +15,7 @@ time = 1.0 script = ExtResource("3_rxd5p") target_character = NodePath("../HiroAI") target_type = "Node" +use_character_speed = false speed = 75.0 animation_state = "cut_walk" target_vector = Vector2(0, 0) diff --git a/Scripts/Characters/base.gd b/Scripts/Characters/base.gd index 4ca400d..4196e3b 100644 --- a/Scripts/Characters/base.gd +++ b/Scripts/Characters/base.gd @@ -46,7 +46,8 @@ func _on_cutscene_issued_command(command: CutsceneCommand, manager: CutsceneMana movement_scripted_target = command.target_vector if command.target_type == "Vector" else manager.get_node(command.target_node).global_position var approach_direction = global_position.direction_to(movement_scripted_target) set_animation_direction(approach_direction) - velocity = command.speed * approach_direction + var move_speed = speed if command.use_character_speed else command.speed + velocity = move_speed * approach_direction movement_scripted_by = manager movement_scripted_speed = command.speed anim_playback.travel(command.animation_state) diff --git a/Scripts/Cutscenes/Commands/move_character.gd b/Scripts/Cutscenes/Commands/move_character.gd index 769bb98..14217e4 100644 --- a/Scripts/Cutscenes/Commands/move_character.gd +++ b/Scripts/Cutscenes/Commands/move_character.gd @@ -8,6 +8,10 @@ class_name MoveCharacterCommand set(value): target_type = value notify_property_list_changed() +@export var use_character_speed = true: + set(value): + use_character_speed = value + notify_property_list_changed() @export var speed: float = 300 ## AnimationTreeFiniteStateMachine state node that will be transitioned to. @export var animation_state: String = "" @@ -25,3 +29,8 @@ func _validate_property(property: Dictionary): property.usage &= ~PROPERTY_USAGE_READ_ONLY elif property.name == "target_vector" and target_type == "Node": property.usage |= PROPERTY_USAGE_READ_ONLY + + if property.name == "speed" and use_character_speed: + property.usage |= PROPERTY_USAGE_READ_ONLY + elif property.name == "speed" and not use_character_speed: + property.usage &= ~PROPERTY_USAGE_READ_ONLY