[gd_scene load_steps=9 format=3 uid="uid://ul8o2n823qod"] [ext_resource type="Script" path="res://content/scripts/player.gd" id="1_i6r2s"] [ext_resource type="Script" path="res://content/scripts/smoother.gd" id="2_dpu6i"] [ext_resource type="Script" path="res://content/scripts/dampened_camera.gd" id="3_24qwg"] [ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="4_erffw"] [ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="5_mmqqh"] [ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="6_8xdrw"] [ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="7_525mu"] [sub_resource type="CylinderShape3D" id="CylinderShape3D_tpgoe"] height = 1.8 radius = 0.25 [node name="Player" type="StaticBody3D" node_paths=PackedStringArray("head", "body", "camera", "collision_shape", "state_chart")] script = ExtResource("1_i6r2s") slope_limit = 40.0 step_height = 0.3 snap_to_ground_distance = 0.3 head = NodePath("Body/Head") body = NodePath("Body") camera = NodePath("Body/Head/Smoother/Camera3D") collision_shape = NodePath("MoveCollider") state_chart = NodePath("StateChart") [node name="MoveCollider" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0) shape = SubResource("CylinderShape3D_tpgoe") [node name="Body" type="Node3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0) [node name="Head" type="Node3D" parent="Body"] [node name="Smoother" type="Node3D" parent="Body/Head" node_paths=PackedStringArray("target")] script = ExtResource("2_dpu6i") target = NodePath("..") [node name="Camera3D" type="Camera3D" parent="Body/Head/Smoother" node_paths=PackedStringArray("target")] script = ExtResource("3_24qwg") target = NodePath("..") [node name="StateChart" type="Node" parent="."] script = ExtResource("4_erffw") [node name="Root" type="Node" parent="StateChart"] script = ExtResource("5_mmqqh") initial_state = NodePath("Grounded") [node name="Grounded" type="Node" parent="StateChart/Root"] script = ExtResource("5_mmqqh") initial_state = NodePath("Idle") [node name="On Jump" type="Node" parent="StateChart/Root/Grounded"] script = ExtResource("7_525mu") to = NodePath("../../Airborne/Jumping") event = &"Jump" [node name="On Airborne" type="Node" parent="StateChart/Root/Grounded"] script = ExtResource("7_525mu") to = NodePath("../../Airborne/Falling") event = &"Airborne" [node name="Idle" type="Node" parent="StateChart/Root/Grounded"] script = ExtResource("5_mmqqh") initial_state = NodePath("Standling") [node name="Crouched" type="Node" parent="StateChart/Root/Grounded/Idle"] script = ExtResource("6_8xdrw") [node name="On Crouch" type="Node" parent="StateChart/Root/Grounded/Idle/Crouched"] script = ExtResource("7_525mu") to = NodePath("../../Standling") event = &"Crouch" [node name="On Move" type="Node" parent="StateChart/Root/Grounded/Idle/Crouched"] script = ExtResource("7_525mu") to = NodePath("../../../Moving/Crouch Walking") event = &"Move" [node name="Standling" type="Node" parent="StateChart/Root/Grounded/Idle"] script = ExtResource("6_8xdrw") [node name="On Crouch" type="Node" parent="StateChart/Root/Grounded/Idle/Standling"] script = ExtResource("7_525mu") to = NodePath("../../Crouched") event = &"Crouch" [node name="On Move" type="Node" parent="StateChart/Root/Grounded/Idle/Standling"] script = ExtResource("7_525mu") to = NodePath("../../../Moving/Running") event = &"Move" [node name="Moving" type="Node" parent="StateChart/Root/Grounded"] script = ExtResource("5_mmqqh") initial_state = NodePath("Running") [node name="Crouch Walking" type="Node" parent="StateChart/Root/Grounded/Moving"] script = ExtResource("6_8xdrw") [node name="On Idle" type="Node" parent="StateChart/Root/Grounded/Moving/Crouch Walking"] script = ExtResource("7_525mu") to = NodePath("../../../Idle/Crouched") event = &"Idle" [node name="On Crouch" type="Node" parent="StateChart/Root/Grounded/Moving/Crouch Walking"] script = ExtResource("7_525mu") to = NodePath("../../Running") event = &"Crouch" [node name="Running" type="Node" parent="StateChart/Root/Grounded/Moving"] script = ExtResource("6_8xdrw") [node name="On Idle" type="Node" parent="StateChart/Root/Grounded/Moving/Running"] script = ExtResource("7_525mu") to = NodePath("../../../Idle/Standling") event = &"Idle" [node name="On Crouch" type="Node" parent="StateChart/Root/Grounded/Moving/Running"] script = ExtResource("7_525mu") to = NodePath("../../Crouch Walking") event = &"Crouch" [node name="Airborne" type="Node" parent="StateChart/Root"] script = ExtResource("5_mmqqh") initial_state = NodePath("Jumping") [node name="On Grounded" type="Node" parent="StateChart/Root/Airborne"] script = ExtResource("7_525mu") to = NodePath("../../Grounded/Idle/Standling") event = &"Grounded" [node name="Jumping" type="Node" parent="StateChart/Root/Airborne"] script = ExtResource("6_8xdrw") [node name="On Airborne" type="Node" parent="StateChart/Root/Airborne/Jumping"] script = ExtResource("7_525mu") to = NodePath("../../Falling") event = &"Airborne" [node name="Falling" type="Node" parent="StateChart/Root/Airborne"] script = ExtResource("6_8xdrw") [connection signal="child_state_entered" from="StateChart/Root" to="." method="_on_root_child_state_entered"] [connection signal="state_processing" from="StateChart/Root" to="." method="_on_root_state_processing"] [connection signal="state_processing" from="StateChart/Root/Grounded/Idle" to="." method="_on_idle_state_processing"] [connection signal="state_physics_processing" from="StateChart/Root/Grounded/Moving/Running" to="." method="_on_running_state_physics_processing"] [connection signal="state_physics_processing" from="StateChart/Root/Airborne/Jumping" to="." method="_on_jumping_state_physics_processing"] [connection signal="state_physics_processing" from="StateChart/Root/Airborne/Falling" to="." method="_on_falling_state_physics_processing"]