Godot_Bouncy_Ball_Prototype/Player/player_camera_basis.gd

9 lines
296 B
GDScript3
Raw Normal View History

2023-09-03 14:32:48 +00:00
extends Node3D
func _process(_delta):
# Copy only the Y rotation of the camera pivot.
# This avoids the problem of the transform.basis not pointing forward if you tilt the camera
# up or down, messing with the movement vector of the player
rotation = Vector3(0, get_parent().rotation.y, 0)