diff --git a/behaviours/skitter_from_mouse.gd b/behaviours/skitter_from_mouse.gd index abc7fd3..68ab6a9 100644 --- a/behaviours/skitter_from_mouse.gd +++ b/behaviours/skitter_from_mouse.gd @@ -12,7 +12,7 @@ signal calmed @export var directions: Array[Vector2] = [] @onready var calm_timer: Timer = $"CalmTimer" -@onready var hover_detector: HoverDetector = $"HoverDetector" +@onready var scare_area: HoverDetector = $"HoverDetector" enum State { CALM, SCARED } @@ -44,7 +44,7 @@ func _physics_process(delta: float) -> void: move.emit(movement) func _on_calm_timer_timeout() -> void: - if hover_detector.mouse_inside: + if scare_area.mouse_inside: scare() else: calm() diff --git a/behaviours/skitter_from_mouse.tscn b/behaviours/skitter_from_mouse.tscn index abebc61..77f1ecd 100644 --- a/behaviours/skitter_from_mouse.tscn +++ b/behaviours/skitter_from_mouse.tscn @@ -6,12 +6,12 @@ [node name="SkitterFromMouse" type="Node2D"] script = ExtResource("1_ftcf8") -[node name="HoverDetector" parent="." instance=ExtResource("2_cuaq0")] +[node name="ScareArea" parent="." instance=ExtResource("2_cuaq0")] [node name="CalmTimer" type="Timer" parent="."] [connection signal="calmed" from="." to="." method="_on_calmed"] [connection signal="move" from="." to="." method="_on_move"] [connection signal="scared" from="." to="." method="_on_scared"] -[connection signal="mouse_entered" from="HoverDetector" to="." method="_on_hover_detector_mouse_entered"] +[connection signal="mouse_entered" from="ScareArea" to="." method="_on_hover_detector_mouse_entered"] [connection signal="timeout" from="CalmTimer" to="." method="_on_calm_timer_timeout"]