Initial commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
extends Area3D
|
||||
class_name GrabBox
|
||||
|
||||
signal grabbedByPlayer
|
||||
@export var obj: GrabableObject
|
||||
@export var type: String #Used to signify the type of Object for other code interacting with the grab box
|
||||
@export var heavy: bool = false
|
||||
|
||||
func _ready() -> void:
|
||||
set_collision_layer_value(5,true) #Enables Grabing colision layer
|
||||
set_collision_layer_value(1,false) #Disables Default collision layer
|
||||
set_collision_mask_value(1,false)
|
||||
|
||||
func grab() -> GrabableObject:
|
||||
if !obj: return
|
||||
if !obj.isGrabbed:
|
||||
grabbedByPlayer.emit()
|
||||
return obj
|
||||
return null
|
||||
@@ -0,0 +1,14 @@
|
||||
extends Skeleton3D
|
||||
|
||||
var bones: Array[int] = [6,11,16,21,26,31,36,41]
|
||||
var boneRotations: Array[Quaternion]
|
||||
|
||||
func _ready() -> void:
|
||||
for bone in bones:
|
||||
boneRotations.push_back(get_bone_pose_rotation(bone))
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
var x = 0
|
||||
for bone in bones:
|
||||
set_bone_pose(bone, boneRotations[x])
|
||||
x += 1
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.6 MiB |
Reference in New Issue
Block a user