From 54d9ff1cddd06c95f98ee8a97c57339baa4fba35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Sat, 20 Nov 2021 18:43:32 +0100 Subject: [PATCH] Make infinite loop more rounded with better rails --- scenes/base_track_level.gd | 2 +- scenes/infinite_loop_track_level.tscn | 4 ++-- vehicles/vehicle.gd | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scenes/base_track_level.gd b/scenes/base_track_level.gd index b6200bb..6607c5c 100644 --- a/scenes/base_track_level.gd +++ b/scenes/base_track_level.gd @@ -33,7 +33,7 @@ func reset_player_to(node_to_reset_to: Node, player_node: BuggedVehicle) -> void ).origin, node_to_reset_to.global_transform.basis.y ) - player_node.reset_transform.origin += node_to_reset_to.global_transform.basis.y * 5 + player_node.reset_transform.origin += node_to_reset_to.global_transform.basis.y * 3 func _process(_delta: float) -> void: diff --git a/scenes/infinite_loop_track_level.tscn b/scenes/infinite_loop_track_level.tscn index ed78da0..6eaf082 100644 --- a/scenes/infinite_loop_track_level.tscn +++ b/scenes/infinite_loop_track_level.tscn @@ -90,7 +90,7 @@ curve = SubResource( 4 ) [node name="Track" type="CSGPolygon" parent="Path" index="0"] use_collision = true -polygon = PoolVector2Array( -10, -3, -2, -1, 2, 0, 10, 3 ) +polygon = PoolVector2Array( -10, -3, -10, 0, -5, -2, -2, -3, 2, -3, 5, -2, 10, 0, 10, -3 ) mode = 2 path_node = NodePath("..") path_interval_type = 0 @@ -105,7 +105,7 @@ material = SubResource( 6 ) [node name="Rails" type="CSGPolygon" parent="Path" index="1"] use_collision = true -polygon = PoolVector2Array( -10, 3, -12, 3, -12, -3.1, 12, -3.1, 12, 6, 10, 6, 10, 2.9, -10, -3.1 ) +polygon = PoolVector2Array( 0, -6, -6, -5, -12, -2, -14, 2, -16, 5, -12, 8, -10, 9, -10, 8, -12, 4, -12, 2, -10, 0, -11, 0, -6, -4, 6, -4, 11, 0, 10, 0, 12, 2, 12, 4, 10, 8, 10, 9, 12, 8, 16, 5, 14, 2, 12, -2, 6, -5 ) mode = 2 path_node = NodePath("..") path_interval_type = 0 diff --git a/vehicles/vehicle.gd b/vehicles/vehicle.gd index 555a564..45c089a 100644 --- a/vehicles/vehicle.gd +++ b/vehicles/vehicle.gd @@ -70,9 +70,9 @@ func _ready(): func _integrate_forces(state: PhysicsDirectBodyState) -> void: if reset_transform != Transform.IDENTITY: - state.set_transform(reset_transform) state.linear_velocity = Vector3.ZERO state.angular_velocity = Vector3.ZERO + state.set_transform(reset_transform) reset_transform = Transform.IDENTITY