Browse Source

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

Christen Lofland 1 năm trước cách đây
mục cha
commit
f70868ce22
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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,