18 lines
546 B
GDScript
18 lines
546 B
GDScript
extends Camera3D
|
|
|
|
var target_angle:float # the position where the camera needs to be
|
|
var current_angle:float # the position where the camera currently is
|
|
|
|
func _physics_process(_delta: float) -> void:
|
|
'''
|
|
Controls where the camera is pointed based on which player is selected
|
|
'''
|
|
|
|
fov = ((20.0 * GLOBALVARS.seconds_left/GLOBALVARS.start_seconds)+20.0)
|
|
|
|
target_angle = (abs(GLOBALVARS.selected_player) * 90)
|
|
if current_angle != target_angle:
|
|
current_angle += 0.1*(target_angle-current_angle)
|
|
|
|
global_rotation_degrees.y = current_angle
|