fix entity spawn for special scene + fix wagon movement

This commit is contained in:
2026-06-03 19:26:12 +02:00
parent 243f89d9d2
commit 584579afb8
8 changed files with 148 additions and 32 deletions

View File

@@ -538,10 +538,6 @@ func _snap_wagons_to_progress(total_length: float = 0.0) -> void:
if total_length <= 0.0:
return
var direction: float = 1.0
if train_speed < 0.0:
direction = -1.0
for i in range(wagon_instances.size()):
var wagon: Node3D = wagon_instances[i]
if not is_instance_valid(wagon):
@@ -551,7 +547,7 @@ func _snap_wagons_to_progress(total_length: float = 0.0) -> void:
if i < wagon_progress_offsets.size():
wagon_offset = wagon_progress_offsets[i]
var wagon_progress: float = train_progress - direction * wagon_offset
var wagon_progress: float = train_progress - wagon_offset
var vehicle_progress: float = wrapf(wagon_progress, 0.0, total_length)
var center_position: Vector3 = to_global(curve.sample_baked(vehicle_progress, true))