killbox/scenes_old_2/utils/camera_mount/camera_mount.gd

27 lines
606 B
GDScript3
Raw Normal View History

2025-02-17 12:57:31 +00:00
extends Node3D
class_name CameraMount
# -- When camera mount is not active, client shouldn't connect to it
@export var active: bool = false
@export var default: bool = false
2025-02-17 16:34:47 +00:00
@export var accept_input: bool = false
2025-02-17 12:57:31 +00:00
var camera: Camera3D
2025-02-18 12:30:48 +00:00
2025-02-17 12:57:31 +00:00
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
camera = Camera3D.new()
add_child(camera)
2025-02-18 12:30:48 +00:00
2025-02-17 12:57:31 +00:00
@rpc("any_peer", "call_local", "reliable")
2025-02-18 12:30:48 +00:00
func connect_to_camera() -> void:
2025-02-17 12:57:31 +00:00
if active:
camera.make_current()
2025-02-18 12:30:48 +00:00
2025-02-17 12:57:31 +00:00
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass