Godot_Bouncy_Ball_Prototype/Player/player_camera_basis.gd

9 lines
296 B
GDScript

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)