diff --git a/blends/giant.blend b/blends/giant.blend index 2db30cd..4230430 100644 Binary files a/blends/giant.blend and b/blends/giant.blend differ diff --git a/blends/giant.blend1 b/blends/giant.blend1 deleted file mode 100644 index dc956fe..0000000 Binary files a/blends/giant.blend1 and /dev/null differ diff --git a/godot/Models/grape_man.gd b/godot/Models/grape_man.gd index 8195d33..5beed9c 100644 --- a/godot/Models/grape_man.gd +++ b/godot/Models/grape_man.gd @@ -1,6 +1,7 @@ extends Node3D @onready var animation: AnimationNodeStateMachinePlayback = $AnimationTree.get("parameters/playback") +@onready var pickup_bone_idx = $rig/Skeleton3D.find_bone("PickupBone") signal anim_check_grab(position: Vector3) @@ -28,8 +29,15 @@ func idle_hold(): animation.travel("IdleHold") func animation_key_grab(): - emit_signal("anim_check_grab", $GrabPointLocation.global_transform) - + emit_signal("anim_check_grab", get_pickup_bone_location()) + +func get_pickup_bone_location() -> Vector3: + var trans = $rig/Skeleton3D.global_transform * $rig/Skeleton3D.get_bone_global_pose(pickup_bone_idx) + return trans.origin + +func _process(_delta): + print(get_pickup_bone_location()) + func animation_key_pickup_completed(): pickup_animation_in_progress = false emit_signal("pickup_animation_finished") diff --git a/godot/Models/grape_man.tscn b/godot/Models/grape_man.tscn index 92f2645..1093831 100644 --- a/godot/Models/grape_man.tscn +++ b/godot/Models/grape_man.tscn @@ -154,7 +154,7 @@ transform = Transform3D(0.065, 0, 0, 0, 0.065, 0, 0, 0, 0.065, 0, 0, 0) script = ExtResource("2_ksje8") [node name="Skeleton3D" parent="rig" index="0"] -bones/0/rotation = Quaternion(0.10507, 0, 0, 0.994465) +bones/0/rotation = Quaternion(0.0889488, 0, 0, 0.996036) bones/1/rotation = Quaternion(-0.0891896, 1.18734e-07, -1.06322e-08, 0.996015) bones/2/rotation = Quaternion(0.0133933, -1.19199e-07, 1.5966e-09, 0.99991) bones/3/rotation = Quaternion(-0.00997737, 0.100365, -0.694951, 0.711948) @@ -167,13 +167,10 @@ bones/7/rotation = Quaternion(0.0142813, -6.34259e-18, -4.44044e-16, 0.999898) bones/10/rotation = Quaternion(0.105246, 0.0039338, -0.0113526, 0.994374) bones/15/rotation = Quaternion(0.105246, -0.0039338, 0.0113526, 0.994374) -[node name="GrabPointLocation" type="Node3D" parent="." index="2"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.29365) - -[node name="OmniLight3D" type="OmniLight3D" parent="." index="3"] +[node name="OmniLight3D" type="OmniLight3D" parent="." index="2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.289473, 8.26292, 4.26359) -[node name="AnimationTree" type="AnimationTree" parent="." index="4"] +[node name="AnimationTree" type="AnimationTree" parent="." index="3"] tree_root = SubResource("AnimationNodeStateMachine_6mfdu") anim_player = NodePath("../AnimationPlayer") active = true diff --git a/godot/Player.gd b/godot/Player.gd index 15bd727..9ae064f 100644 --- a/godot/Player.gd +++ b/godot/Player.gd @@ -16,6 +16,7 @@ func _ready(): $CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(-60), deg_to_rad(-11)) + func _process(_delta): # Brings your mouse out of the window if you press escape. Add pause screen function here? if Input.is_action_pressed("ui_cancel"):