# if we find a head tracking obj, add it to the array unless it's already there
func _on_head_turn_area_entered(area: Area3D) -> void:
- for node in area.get_parent().get_children().filter(func(c): return c.is_in_group("player-headTrack")):
+ for node in area.get_children().filter(func(c: Node3D): return c.is_in_group("player-headTrack")):
var i = _head_track_arr.find(node)
if i < 0:
_head_track_arr.append(node)
func _on_head_turn_area_exited(area: Area3D) -> void:
- for node in area.get_parent().get_children().filter(func(c): return c.is_in_group("player-headTrack")):
+ for node in area.get_children().filter(func(c: Node3D): return c.is_in_group("player-headTrack")):
var i = _head_track_arr.find(node)
if i >= 0:
_head_track_arr.remove_at(i)
-[gd_scene load_steps=10 format=3 uid="uid://cp6xm8gp6csx"]
+[gd_scene load_steps=11 format=3 uid="uid://cp6xm8gp6csx"]
[ext_resource type="Script" path="res://player/player.gd" id="1_h17j6"]
[ext_resource type="PackedScene" uid="uid://2tvylmtejq0u" path="res://william.tscn" id="1_sujn1"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_ntdse"]
radius = 4.0
+[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_sdmc3"]
+
[sub_resource type="SphereShape3D" id="SphereShape3D_4dtvp"]
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_frf40"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -3.91559)
shape = SubResource("CylinderShape3D_ntdse")
-[node name="npcTrackPoint" type="Node3D" parent="WilliamSkin" groups=["npc-headTrack"]]
-transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.78197, 0)
+[node name="Area3D" type="Area3D" parent="WilliamSkin"]
+
+[node name="CollisionShape3D" type="CollisionShape3D" parent="WilliamSkin/Area3D"]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
+shape = SubResource("CapsuleShape3D_sdmc3")
+
+[node name="npcTrackPoint" type="Node3D" parent="WilliamSkin/Area3D" groups=["npc-headTrack"]]
[node name="cameraPivot" type="Node3D" parent="."]
func _on_head_turn_area_entered(area: Area3D) -> void:
- for node in area.get_parent().get_children().filter(func(c): return c.is_in_group("npc-headTrack")):
+ for node in area.get_children().filter(func(c: Node3D): return c.is_in_group("npc-headTrack")):
var i = _head_track_arr.find(node)
if i < 0:
_head_track_arr.append(node)
func _on_head_turn_area_exited(area: Area3D) -> void:
- for node in area.get_parent().get_children().filter(func(c): return c.is_in_group("npc-headTrack")):
+ for node in area.get_children().filter(func(c: Node3D): return c.is_in_group("npc-headTrack")):
var i = _head_track_arr.find(node)
if i >= 0:
_head_track_arr.remove_at(i)
-[gd_scene load_steps=4 format=3 uid="uid://bmcw5a71lsldu"]
+[gd_scene load_steps=5 format=3 uid="uid://bmcw5a71lsldu"]
[ext_resource type="PackedScene" uid="uid://2tvylmtejq0u" path="res://william.tscn" id="1_fk6op"]
[ext_resource type="Script" path="res://test/npc.gd" id="1_tko4h"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_rgxya"]
radius = 3.27162
+[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_75ajl"]
+
[node name="NonPlayerCharacter" type="Node3D"]
script = ExtResource("1_tko4h")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 3.17898)
shape = SubResource("CylinderShape3D_rgxya")
-[node name="playerTrackPoint" type="Node3D" parent="skin" groups=["player-eyeTrack", "player-headTrack"]]
+[node name="Area3D" type="Area3D" parent="skin"]
+
+[node name="CollisionShape3D" type="CollisionShape3D" parent="skin/Area3D"]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
+shape = SubResource("CapsuleShape3D_75ajl")
+
+[node name="playerTrackPoint" type="Node3D" parent="skin/Area3D" groups=["player-eyeTrack", "player-headTrack"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.77777, 0.0828433)
[connection signal="area_entered" from="skin/headTurn" to="." method="_on_head_turn_area_entered"]
bones/1/rotation = Quaternion(-0.0644764, -6.13826e-09, -1.28759e-08, 0.997919)
bones/1/scale = Vector3(1, 1, 1)
bones/2/rotation = Quaternion(-0.077464, 3.50653e-08, -6.15945e-08, 0.996995)
-bones/2/scale = Vector3(1, 1, 1)
bones/3/rotation = Quaternion(0.00162711, -1.22272e-07, 2.23079e-08, 0.999999)
bones/3/scale = Vector3(1, 1, 1)
bones/4/rotation = Quaternion(0.162761, 0.00598545, 0.102777, 0.98128)
bones/88/rotation = Quaternion(0.907364, 1.49678e-07, 3.25313e-07, 0.420345)
bones/89/position = Vector3(1.83685e-14, -0.0667295, 0.179103)
bones/89/rotation = Quaternion(0.229327, -1.03392e-07, -7.7942e-08, 0.973349)
-bones/89/scale = Vector3(1, 1, 1)
bones/90/rotation = Quaternion(-0.230471, 3.48e-07, -2.74743e-08, 0.973079)
bones/90/scale = Vector3(1, 1, 1)
bones/91/position = Vector3(1.86233e-09, -0.0629948, 0.0806333)