godot-psd-training/sceen/people/player.tscn
2024-07-17 11:23:34 +08:00

63 lines
2.8 KiB
Plaintext

[gd_scene load_steps=8 format=3 uid="uid://c6noskjp3ks4p"]
[ext_resource type="Script" path="res://sceen/people/Player.gd" id="1_pursd"]
[ext_resource type="PackedScene" uid="uid://ql5aokids4f6" path="res://sceen/people/people.tscn" id="2_ggqm4"]
[ext_resource type="Script" path="res://sceen/people/StateMachine/StateMachine.gd" id="3_ltxep"]
[ext_resource type="Script" path="res://sceen/people/Idle.gd" id="4_ru6er"]
[ext_resource type="Script" path="res://sceen/people/Walk.gd" id="5_aav7k"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_n25t3"]
radius = 0.4
[sub_resource type="BoxShape3D" id="BoxShape3D_ywkfy"]
size = Vector3(0.113147, 0.145019, 0.102899)
[node name="Player" type="CharacterBody3D"]
script = ExtResource("1_pursd")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.701889, 0)
visible = false
shape = SubResource("CapsuleShape3D_n25t3")
[node name="people" parent="." instance=ExtResource("2_ggqm4")]
transform = Transform3D(-1, 0, -1.50996e-07, 0, 1, 0, 1.50996e-07, 0, -1, 0, 0, 0)
[node name="Area3D" type="Area3D" parent="." groups=["player"]]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.701889, 0)
shape = SubResource("CapsuleShape3D_n25t3")
[node name="StateMachine" type="Node3D" parent="." node_paths=PackedStringArray("current_state")]
script = ExtResource("3_ltxep")
current_state = NodePath("Idle")
[node name="Idle" type="Node3D" parent="StateMachine" node_paths=PackedStringArray("player")]
script = ExtResource("4_ru6er")
player = NodePath("../..")
[node name="Walk" type="Node3D" parent="StateMachine" node_paths=PackedStringArray("player")]
script = ExtResource("5_aav7k")
player = NodePath("../..")
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
avoidance_enabled = true
height = 2.0
[node name="NavigationTimer" type="Timer" parent="."]
wait_time = 0.05
[node name="PeopleFrontArea3D" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.00255, -0.378363)
[node name="CollisionShape3D" type="CollisionShape3D" parent="PeopleFrontArea3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00299683, -0.0159907, 0.00346985)
shape = SubResource("BoxShape3D_ywkfy")
[connection signal="area_entered" from="Area3D" to="." method="_on_area_3d_area_entered"]
[connection signal="area_exited" from="Area3D" to="." method="_on_area_3d_area_exited"]
[connection signal="timeout" from="NavigationTimer" to="." method="_on_navigation_timer_timeout"]
[connection signal="area_entered" from="PeopleFrontArea3D" to="." method="_on_people_front_area_3d_area_entered"]
[connection signal="area_exited" from="PeopleFrontArea3D" to="." method="_on_people_front_area_3d_area_exited"]