1
0
This repository has been archived on 2025-06-02. You can view files and clone it, but cannot push or open issues or pull requests.

16 lines
472 B
GDScript3
Raw Normal View History

2025-03-21 11:49:36 -04:00
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
2025-03-21 11:49:36 -04:00
func _physics_process(_delta: float) -> void:
'''
Controls where the camera is pointed based on which player is selected
'''
2025-03-21 17:24:21 -04:00
target_angle = (abs(GLOBALVARS.selected_player) * 90)
2025-03-21 11:49:36 -04:00
if current_angle != target_angle:
current_angle += 0.1*(target_angle-current_angle)
2025-03-21 11:49:36 -04:00
global_rotation_degrees.y = current_angle