Skip to content

Commit

Permalink
Replace initial_facing_direction with a smarter approach (why didn't …
Browse files Browse the repository at this point in the history
…I think of this the first time)
  • Loading branch information
Zakarya committed Mar 26, 2024
1 parent bb36e69 commit 11b41ea
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions addons/fpc/character.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 11b41ea

Please sign in to comment.