Skip to main content

STPickup

class StageTime.SDK.STPickup

Lets players pick up this object in VR and on desktop (like VRC_Pickup + VRC_ObjectSync). Its position is synced for everyone and the holder becomes the owner. Needs a collider. Scripts on the same GameObject get OnPickup, OnDrop, OnPickupUseDown and OnPickupUseUp. Without a Rigidbody it stays where it is dropped. Add a Rigidbody for physics: its Is Kinematic and Use Gravity are kept, a non-kinematic pickup can be thrown, and it falls, rolls and collides the same for everyone.

Add it with Add Component → StageTime/ST Pickup.

Fields​

pickupable​

bool pickupable

Players can pick this up.

DisallowTheft​

bool DisallowTheft

Others cannot take it out of the holder's hand.

InteractionText​

string InteractionText

Shown when a player points at it.

UseText​

string UseText

Shown while held, for the use button. Empty = no use action.

SyncBackend​

IObjectSyncBackend SyncBackend

Set by StageTime's runtime.

Properties​

IsHeld​

bool IsHeld

True while someone holds it.

currentPlayer​

StageTimePlayer currentPlayer

The player holding it, or null (also once that player has left the room).

Methods​

Drop​

void Drop()

Makes the local holder drop it.

HandOver​

void HandOver(STPickup other)

When the local player holds this pickup, lets go of it and holds other in the same hand instead (next frame), for a deck that hands out cards or a rack that hands out tools. Call it from OnPickup. Does nothing when the local player doesn't hold this pickup or other can't be picked up.

Respawn​

void Respawn()

Puts it back where it started, for everyone, and stops it.

SetKinematic​

void SetKinematic(bool value)

Makes its Rigidbody kinematic or not, for everyone (needs a Rigidbody added in the editor).

SetGravity​

void SetGravity(bool value)

Turns gravity on or off for its Rigidbody, for everyone (needs a Rigidbody added in the editor).