23 lines
559 B
GDScript3
23 lines
559 B
GDScript3
|
extends Spatial
|
||
|
|
||
|
onready var util = get_node("/root/Util")
|
||
|
onready var active_physics_node: Spatial = $OnFootPhysics
|
||
|
|
||
|
|
||
|
func camera():
|
||
|
return $"Smoothing/CameraController/Rotation/Camera"
|
||
|
|
||
|
func camera_position() -> Vector3:
|
||
|
return camera().global_transform.origin
|
||
|
|
||
|
func set_physics_node(node: Spatial):
|
||
|
if active_physics_node == node:
|
||
|
return
|
||
|
#util.activate_node(node)
|
||
|
#util.deactivate_node(active_physics_node)
|
||
|
|
||
|
$Smoothing.target = NodePath("../" + node.name)
|
||
|
node.global_transform = active_physics_node.global_transform
|
||
|
active_physics_node = node
|
||
|
|