Skip to content
NGenesis edited this page Mar 8, 2021 · 18 revisions

Unity Events

These are the method stubs available for Unity events.

Events
FixedUpdate OnJointBreak OnRenderImage
LateUpdate OnJointBreak2D OnRenderObject
OnAnimatorIK OnMouseDown OnTransformChildrenChanged
OnAnimatorMove OnMouseDrag OnTransformParentChanged
OnCollisionEnter OnMouseEnter OnTriggerEnter
OnCollisionEnter2D OnMouseExit OnTriggerEnter2D
OnCollisionExit OnMouseOver OnTriggerExit
OnCollisionExit2D OnMouseUp OnTriggerExit2D
OnCollisionStay OnMouseUpAsButton OnTriggerStay
OnCollisionStay2D OnParticleCollision OnTriggerStay2D
OnControllerColliderHit OnParticleTrigger OnWillRenderObject
OnDestroy OnPostRender Start
OnDisable OnPreCull Update
OnEnable OnPreRender

Udon Events

These are the method stubs you can override via UdonSharpBehaviour.

These methods have to be public

public override void <method>() {}
Returns Name
void Interact() Fired when a user interacts with the object
Will add a box collider if no collider is present.
void OnDrop() Requires VRC_Pickup
void OnOwnershipTransferred() Fired every time a UdonBehaviour changes owner
void OnPickup() Requires VRC_Pickup
void OnPickupUseDown() Requires VRC_Pickup
void OnPickupUseUp() Requires VRC_Pickup
void OnPlayerJoined(VRCPlayerApi) Fired when a new player joins the instance
void OnPlayerLeft(VRCPlayerApi) Fired when a player leaves the instance
void OnPlayerRespawn(VRCPlayerApi) Fired when a player respawns
void OnSpawn() Fired when a object is spawned via network instantiation
void OnStationEntered(VRCPlayerApi) Requires VRC_Station
void OnStationExited(VRCPlayerApi) Requires VRC_Station
void OnVideoEnd() When the video player ends playback
void OnVideoError(VideoError videoError) When an error occurs with the player
void OnVideoLoop() If looping is enabled, this will fire at the end
void OnVideoPause() When the video player is paused
void OnVideoPlay() When you start playing a video
void OnVideoStart() When a video is playing for the first time?
void OnVideoReady() When the video player has loaded the url
void OnPreSerialization() Fired before sending network data
void OnDeserialization() Fired when network data is received
void OnPlayerTriggerEnter(VRCPlayerApi) Player enters a trigger
void OnPlayerTriggerStay(VRCPlayerApi) Player stays in a trigger
void OnPlayerTriggerExit(VRCPlayerApi) Player leaves a trigger
void OnPlayerCollisionEnter(VRCPlayerApi) Player collides with a collider
void OnPlayerCollisionStay(VRCPlayerApi) Player stays on a collider
void OnPlayerCollisionExit(VRCPlayerApi) Player leaves the collider
void OnPlayerParticleCollision(VRCPlayerApi) A collision particle hits the player
void MidiNoteOn(int channel, int number, int velocity) Triggered when a Note On message is received, typically by pressing a key / pad on your device. See Midi in Udon for more information.
void MidiNoteOff(int channel, int number, int velocity) Triggered when a Note Off message is received, typically by releasing a key / pad on your device. See Midi in Udon for more information.
void MidiControlChange(int channel, int number, int value) Triggered when a control change is received. These are typically sent by knobs and sliders on your Midi device. See Midi Events for more information.
void InputJump(bool value, VRC.Udon.Common.UdonInputEventArgs args) See Input Events for more information.
void InputUse(bool value, VRC.Udon.Common.UdonInputEventArgs args) See Input Events for more information.
void InputGrab(bool value, VRC.Udon.Common.UdonInputEventArgs args) See Input Events for more information.
void InputDrop(bool value, VRC.Udon.Common.UdonInputEventArgs args) See Input Events for more information.
void InputMoveHorizontal(float value, VRC.Udon.Common.UdonInputEventArgs args) See Input Events for more information.
void InputMoveVertical(float value, VRC.Udon.Common.UdonInputEventArgs args) See Input Events for more information.
void InputLookHorizontal(float value, VRC.Udon.Common.UdonInputEventArgs args) See Input Events for more information.
void InputLookVertical(float value, VRC.Udon.Common.UdonInputEventArgs args) See Input Events for more information.