Преглед изворни кода

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

Christen Lofland пре 1 година
родитељ
комит
f70868ce22
1 измењених фајлова са 1 додато и 1 уклоњено
  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,