Scripting / Interactables
ICarryObject
Marks an object as carryable by the player. Instruction_Carry searches for this interface in front of the player and calls Take(). The engine then parents the object to the player and stores it in ExecutionContext.carryTarget. Instruction_Drop calls Drop() and unparents it.
Properties
| Property | Type | Description |
|---|---|---|
transform | Transform | The transform of the carryable object. Since your class extends MonoBehaviour (via ExecutionContextElement), implement this as an explicit interface property: Transform ICarryObject.transform => transform; |
Methods
| Method | Description |
|---|---|
Take() | Called when the player picks up the object. Disable the collider to prevent movement collisions while carried. Play a pickup sound or start a carry animation here. |
Drop() | Called when the player drops the object. Re-enable the collider and restore the object to its normal visual state. Play a drop sound here. |
Parenting is automatic
You do not need to call
transform.SetParent() in Take() or Drop(). The engine handles parenting the object to the player during carry and detaching it on drop.