Untracked Files
This commit is contained in:
16
Scripts/Characters/Player/interact_scanner.gd
Normal file
16
Scripts/Characters/Player/interact_scanner.gd
Normal file
@@ -0,0 +1,16 @@
|
||||
extends Area2D
|
||||
|
||||
@export var parent: Node2D
|
||||
@export var direction_component: FacingDirectionComponent
|
||||
|
||||
# Public Methods
|
||||
func OnDirectionChanged() -> void:
|
||||
var direction := direction_component.GetCurrentDirection()
|
||||
if direction == Enums.Directions.LEFT:
|
||||
parent.rotation = deg_to_rad(90)
|
||||
elif direction == Enums.Directions.RIGHT:
|
||||
parent.rotation = deg_to_rad(-90)
|
||||
elif direction == Enums.Directions.UP:
|
||||
parent.rotation = deg_to_rad(180)
|
||||
else:
|
||||
parent.rotation = deg_to_rad(0)
|
||||
Reference in New Issue
Block a user