1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-29 07:21:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Statemachine/SyncTransform.gd
T

22 lines
618 B
GDScript
Raw Normal View History

@tool
extends Node2D
@export var target: Node2D
@export var offsetPosition: Vector2 = Vector2.ZERO
@export var offsetRotation: float = 0.0
@export var multipilerScale: Vector2 = Vector2.ONE
@export var enablePosition: bool = false
@export var enableRotation: bool = false
@export var enableScale: 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)
if enableScale:
global_scale = target.global_scale * multipilerScale