20 lines
577 B
GDScript3
20 lines
577 B
GDScript3
|
|
extends Node3D
|
||
|
|
|
||
|
|
@export var cam_pivot : Node3D #rotate the camera around the room
|
||
|
|
@export var camera : Camera3D
|
||
|
|
@export var cam_target : Marker3D #camera should always look at this
|
||
|
|
var time : float = 0
|
||
|
|
|
||
|
|
# Called when the node enters the scene tree for the first time.
|
||
|
|
func _ready() -> void:
|
||
|
|
pass # Replace with function body.
|
||
|
|
|
||
|
|
|
||
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
|
|
func _process(delta: float) -> void:
|
||
|
|
time += delta
|
||
|
|
camera.position.y = sin(time/10) + 5
|
||
|
|
cam_pivot.rotation_degrees.y = time + 145
|
||
|
|
camera.look_at(cam_target.position)
|
||
|
|
|