mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 07:21:54 +08:00
16 lines
453 B
GDScript
16 lines
453 B
GDScript
|
|
@tool
|
||
|
|
extends Node2D
|
||
|
|
|
||
|
|
@export var target: Node2D
|
||
|
|
@export var offsetPosition: Vector2 = Vector2.ZERO
|
||
|
|
@export var offsetRotation: float = 0.0
|
||
|
|
@export var enablePosition: bool = false
|
||
|
|
@export var enableRotation: bool = false
|
||
|
|
|
||
|
|
func _process(_delta):
|
||
|
|
if is_instance_valid(target):
|
||
|
|
if enablePosition:
|
||
|
|
global_position = target.global_position + offsetPosition
|
||
|
|
if enableRotation:
|
||
|
|
global_rotation = target.global_rotation + deg_to_rad(offsetRotation)
|