This commit is contained in:
Spencer Killen 2023-08-19 18:58:08 -06:00
parent 4ef9927141
commit 7adfcc2766
Signed by: sjkillen
GPG Key ID: F307025B65C860BA
4 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,7 @@
extends Node3D extends Node3D
@onready var animation: AnimationNodeStateMachinePlayback = $AnimationTree.get("parameters/playback") @onready var animation: AnimationNodeStateMachinePlayback = $AnimationTree.get("parameters/playback")
@onready var pickup_bone_idx = $rig/Skeleton3D.find_bone("PickupBone")
signal anim_check_grab(position: Vector3) signal anim_check_grab(position: Vector3)
@ -28,7 +29,11 @@ func idle_hold():
animation.travel("IdleHold") animation.travel("IdleHold")
func animation_key_grab(): 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 animation_key_pickup_completed(): func animation_key_pickup_completed():
pickup_animation_in_progress = false pickup_animation_in_progress = false

View File

@ -153,7 +153,7 @@ transform = Transform3D(0.065, 0, 0, 0, 0.065, 0, 0, 0, 0.065, 0, 0, 0)
script = ExtResource("2_ksje8") script = ExtResource("2_ksje8")
[node name="Skeleton3D" parent="rig" index="0"] [node name="Skeleton3D" parent="rig" index="0"]
bones/0/rotation = Quaternion(0.0930424, 0, 0, 0.995662) bones/0/rotation = Quaternion(0.10292, 0, 0, 0.99469)
bones/1/rotation = Quaternion(-0.0891896, 1.18734e-07, -1.06322e-08, 0.996015) 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/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) bones/3/rotation = Quaternion(-0.00997737, 0.100365, -0.694951, 0.711948)

View File

@ -37,7 +37,7 @@ func _input(event):
holding = weakref(null) holding = weakref(null)
$grape_man/drop.play() $grape_man/drop.play()
else: else:
$grape_man/drop.pickup() $grape_man/pickup.play()
$grape_man.pickup() $grape_man.pickup()