godot-plateformer/addons/phantom_camera/examples/scripts/3D/path_follow.gd

15 lines
452 B
GDScript3
Raw Normal View History

2026-01-02 23:56:22 +08:00
extends Area3D
2025-12-29 11:54:31 +08:00
@export var path_pcam: PhantomCamera3D
func _ready() -> void:
2026-01-02 23:56:22 +08:00
area_shape_entered.connect(_area_shape_entered)
area_shape_exited.connect(_area_shape_exited)
2025-12-29 11:54:31 +08:00
2026-01-02 23:56:22 +08:00
func _area_shape_entered(area_rid: RID, area: Area3D, area_shape_index: int, local_shape_index: int) -> void:
path_pcam.set_priority(20)
2025-12-29 11:54:31 +08:00
2026-01-02 23:56:22 +08:00
func _area_shape_exited(area_rid: RID, area: Area3D, area_shape_index: int, local_shape_index: int) -> void:
path_pcam.set_priority(0)