Files
SpaceBots/.svn/pristine/51/51100e8e9d12d5c16999c94182880025bcea5a9b.svn-base

20 lines
544 B
Plaintext
Raw Normal View History

2026-01-21 23:51:53 +01:00
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