Returns true if the specified object is valid and not a null reference, otherwise false. This is typically used to check VRCPlayerApi objects after a player has left the instance, or GameObject objects that have been destroyed.
Retrieves the type of the specified variable from the behaviour.
void
RequestSerialization()
Triggers the serialization and transmission of any synced variable data to remote clients. This is typically used when a behaviour is set to manual syncing mode.
Populates and returns an array with the current players in the instance. The array parameter must be preallocated with at least VRCPlayerApi.GetPlayerCount elements. See example
Teleports the player to the position, rotation, the spawn orientation, and if you want to lerp on remote
void
EnablePickup(bool enable)
Set if the player can use pickups or not (Need Testing)
void
SetPlayerTag(string tagName, string tagValue)
Assigns a value to the tag for the player. Returns null if the tag has not been assigned. Note that player tags are not synchronized to remote clients.
string
GetPlayerTag(string tagName)
Returns the value of the given tag for the player. Assign a value of null to clear the tag.
void
ClearPlayerTags()
Clears the tags on the given player
void
SetRunSpeed(float speed)
Sets the player run speed
void
SetWalkSpeed(float speed)
Sets the players walk speed
void
SetJumpImpulse(float impulse)
Sets players jump impulse
void
SetGravityStrength(float strength)
Sets the players gravity
void
SetStrafeSpeed(float speed)
Sets the player's strafe speed. The default strafe speed is 2.0f.
float
GetRunSpeed()
Returns the current run speed value
float
GetWalkSpeed()
Returns the current walk speed value
float
GetJumpImpulse()
Returns the current jump impulse value
float
GetGravityStrength()
Returns the current gravity value
float
GetStrafeSpeed()
Returns the player's current strafe speed.
bool
IsUserInVR()
Returns if the current user is in VR
void
UseLegacyLocomotion()
Sets the locomotion to the old system
void
Immobilize(bool immobile)
Prevents user from moving
void
UseAttachedStation()
Sits the players down on the station (Requires VRC_Station on the same gameObject)
Add boost to the Player's voice in decibels, range 0-24
void
SetVoiceDistanceNear(float near)
The near radius, in meters, where volume begins to fall off. It is strongly recommended to leave the Near value at zero for realism and effective spatialization for user voices. In Meters, Range 0 - 1,000,000
void
SetVoiceDistanceFar(float far)
This sets the end of the range for hearing the user's voice. Default is 25 meters. You can lower this to make another player's voice not travel as far, all the way to 0 to effectively 'mute' the player. In Meters, Range is 0 - 1,000,000
void
SetVoiceVolumetricRadius(float radius)
A player's voice is normally simulated to be a point source, however changing this value allows the source to appear to come from a larger area. Keep this at zero unless you know what you're doing. In Meters, Range is 0 -1,000. Default 0
void
SetVoiceLowpass(bool enabled)
When a voice is some distance off, it is passed through a low-pass filter to help with understanding noisy worlds. You can disable this if you want to skip this filter. For example, if you intend for a player to use their voice channel to play a high-quality DJ mix, turning this filter off is advisable.
void
SetAvatarAudioGain(float gain)
Set the Maximum Gain allowed on Avatar Audio. Default is 10. In Decibels, Range 0-10
void
SetAvatarAudioNearRadius(float distance)
This sets the maximum start of the range for hearing the avatar's audio. Default is 40 meters. You can lower this to make another player's avatar not travel as far, all the way to 0 to effectively 'mute' the player. Note that this is compared to the audio source's minDistance, and the smaller value is used.
void
SetAvatarAudioFarRadius(float distance)
This sets the maximum end of the range for hearing the avatar's audio. Default is 40 meters. You can lower this to make another player's avatar not travel as far, all the way to 0 to effectively 'mute' the player. Note that this is compared to the audio source's maxDistance, and the smaller value is used.
void
SetAvatarAudioVolumetricRadius(float radius)
An avatar's audio source is normally simulated to be a point source, however changing this value allows the source to appear to come from a larger area. This should be used carefully, and is mainly for distant audio sources that need to sound "large" as you move past them. Default is 40
void
SetAvatarAudioForceSpatial(bool force)
If this is on, then Spatialization is enabled for avatar audio sources, and the spatialBlend is set to 1. Enabling this prevents avatars from using 2D audio.
void
SetAvatarAudioCustomCurve(bool allow)
This sets whether avatar audio sources can use a pre-configured custom curve.
VRCUrl objects currently cannot be constructed at runtime in Udon and are typically constructed at editor time via editor scripts, or retrieved from a VRCUrlInputField.
VRC Object Pool provides a lightweight method of managing an array of game objects. The pool will manage and synchronize the active state of each object it holds.
Objects are made active by the pool via the TryToSpawn node, which will return the object that was made active, or a null object if none are available. Objects may be returned to the pool by the pool's owner, and automatically disabled, via the Return node.
When objects are enabled by the pool the OnSpawn event is fired, which an udon behaviour on the object may listen for.
Late joiners will have the objects automatically made active or inactive where appropriate.
Changes the kinematic state, usually handled by the Rigidbody of the object but controlled here for sync purposes. When the kinematic state is on, this Rigidbody ignores forces, collisions and joints.
void
SetGravity(bool value)
Changes the gravity state, usually handled by the Rigidbody of the object but controlled here for sync purposes.
void
FlagDiscontinuity()
Trigger this when you want to teleport the object - the changes you make this frame will be applied without smoothing.
This defines how the collision force will be added to the other object which was hit, using Rigidbody.AddForceAtPosition. Note that the force will only be added if AllowCollisionTransfer is on.
bool
DisallowTheft
If other users are allowed to take the pickup out of some else's grip.
These variables are available for syncing across the network with the UdonSynced attribute.
note
In the lists below, 'size' refers to the approximate size in memory. When networked, the data is serialized, which may lead to more data being transmitted. For example, syncing a bool will send at least 1 byte of data (instead of 1 bit) in addition to any networking overhead.
To find out how many bytes of serialized data were, use byteCount in the OnPostSerialization event. You can find more information about syncing on Udon's Network Specs page.