mirror of
https://github.com/tonytins/citylimits
synced 2025-05-05 14:14:49 -04:00
16 lines
396 B
GDScript
16 lines
396 B
GDScript
extends Area2D
|
|
|
|
@export var area_pcam: PhantomCamera2D
|
|
|
|
func _ready() -> void:
|
|
connect("area_entered", _entered_area)
|
|
connect("area_exited", _exited_area)
|
|
|
|
func _entered_area(area_2D: Area2D) -> void:
|
|
if area_2D.get_parent() is CharacterBody2D:
|
|
area_pcam.set_priority(20)
|
|
|
|
func _exited_area(area_2D: Area2D) -> void:
|
|
if area_2D.get_parent() is CharacterBody2D:
|
|
area_pcam.set_priority(0)
|
|
|