From 11b41ea13dd17c3dba46740c478121c3add5122f Mon Sep 17 00:00:00 2001 From: Zakarya Date: Mon, 25 Mar 2024 20:41:57 -0700 Subject: [PATCH] Replace initial_facing_direction with a smarter approach (why didn't I think of this the first time) --- addons/fpc/character.gd | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/addons/fpc/character.gd b/addons/fpc/character.gd index c4ffaa6..7796e13 100644 --- a/addons/fpc/character.gd +++ b/addons/fpc/character.gd @@ -13,8 +13,6 @@ extends CharacterBody3D @export var immobile : bool = false @export_file var default_reticle -@export var initial_facing_direction : Vector3 = Vector3.ZERO - @export_group("Nodes") @export var HEAD : Node3D @export var CAMERA : Camera3D @@ -71,9 +69,8 @@ var gravity : float = ProjectSettings.get_setting("physics/3d/default_gravity") func _ready(): Input.mouse_mode = Input.MOUSE_MODE_CAPTURED - # Set the camera rotation to whatever initial_facing_direction is - if initial_facing_direction: - HEAD.set_rotation_degrees(initial_facing_direction) # I don't want to be calling this function if the vector is zero + HEAD.rotation = rotation + rotation = Vector3.ZERO if default_reticle: change_reticle(default_reticle)