Browse Source

Use `@onready` to init previous_position to prevent errors (#1042)

Christen Lofland 1 year ago
parent
commit
f70868ce22
1 changed files with 1 additions and 1 deletions
  1. 1 1
      3d/truck_town/vehicles/follow_camera.gd

+ 1 - 1
3d/truck_town/vehicles/follow_camera.gd

@@ -24,7 +24,7 @@ var base_fov := fov
 var desired_fov := fov
 
 # Position on the last physics frame (used to measure speed).
-var previous_position := global_position
+@onready var previous_position := global_position
 
 enum CameraType {
 	EXTERIOR,