Skip to main content

Events

Udon Events

These are the method stubs you can override via UdonSharpBehaviour.

These methods have to be public.

public override void <method>() {}

Udon Update Events

Return typeNameDescription
voidPostLateUpdate()Fired near the end of the frame after IK has been calculated. Getting bone positions at this time will give you the most up to date positions so that they are not a frame behind.

Udon Input Events

Return typeNameDescription
voidInteract()Fired when a user interacts with the object
Will add a box collider if no collider is present.
voidInputJump(bool value, VRC.Udon.Common.UdonInputEventArgs args)See Input Events for more information.
voidInputUse(bool value, VRC.Udon.Common.UdonInputEventArgs args)See Input Events for more information.
voidInputGrab(bool value, VRC.Udon.Common.UdonInputEventArgs args)See Input Events for more information.
voidInputDrop(bool value, VRC.Udon.Common.UdonInputEventArgs args)See Input Events for more information.
voidInputMoveHorizontal(float value, VRC.Udon.Common.UdonInputEventArgs args)See Input Events for more information.
voidInputMoveVertical(float value, VRC.Udon.Common.UdonInputEventArgs args)See Input Events for more information.
voidInputLookHorizontal(float value, VRC.Udon.Common.UdonInputEventArgs args)See Input Events for more information.
voidInputLookVertical(float value, VRC.Udon.Common.UdonInputEventArgs args)See Input Events for more information.

Udon Pickup Events

Return typeNameDescription
voidOnDrop()Requires VRC_Pickup
voidOnPickup()Requires VRC_Pickup
voidOnPickupUseDown()Requires VRC_Pickup
voidOnPickupUseUp()Requires VRC_Pickup

Udon Networking Events

Return typeNameDescription
boolOnOwnershipRequest(VRCPlayerApi requester, VRCPlayerApi newOwner)Fired when an UdonBehaviour is going to change owner. Returning true will accept the change in ownership, and returning false will reject the change in ownership.
voidOnOwnershipTransferred(VRCPlayerApi player)Fired every time a UdonBehaviour changes owner
voidOnPreSerialization()Fired before sending network data
voidOnPostSerialization(VRC.Udon.Common.SerializationResult result)Fired after sending network data and provides data on whether the serialization attempt succeeded and how many bytes were serialized.
voidOnDeserialization()Fired when network data is received

Udon Player Events

Return typeNameDescription
voidOnPlayerJoined(VRCPlayerApi player)Fired when a new player joins the instance
voidOnPlayerLeft(VRCPlayerApi player)Fired when a player leaves the instance
voidOnPlayerRespawn(VRCPlayerApi player)Fired when a player respawns
voidOnPlayerTriggerEnter(VRCPlayerApi player)Player enters a trigger
voidOnPlayerTriggerStay(VRCPlayerApi player)Player stays in a trigger
voidOnPlayerTriggerExit(VRCPlayerApi player)Player leaves a trigger
voidOnPlayerCollisionEnter(VRCPlayerApi player)Player collides with a collider
voidOnPlayerCollisionStay(VRCPlayerApi player)Player stays on a collider
voidOnPlayerCollisionExit(VRCPlayerApi player)Player leaves the collider
voidOnPlayerParticleCollision(VRCPlayerApi player)A collision particle hits the player
voidOnControllerColliderHitPlayer(ControllerColliderPlayerHit hit)CharacterController collides with a player

Udon Station Events

Return typeNameDescription
voidOnStationEntered(VRCPlayerApi player)Requires VRC_Station
voidOnStationExited(VRCPlayerApi player)Requires VRC_Station

Udon Video Events

Return typeNameDescription
voidOnVideoEnd()When the video player ends playback
voidOnVideoError(VideoError videoError)When an error occurs with the player
voidOnVideoLoop()If looping is enabled, this will fire at the end
voidOnVideoPause()When the video player is paused
voidOnVideoPlay()When you start playing a video
voidOnVideoStart()When a video is playing for the first time?
voidOnVideoReady()When the video player has loaded the url

Udon MIDI Events

Return typeNameDescription
voidMidiNoteOn(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.
voidMidiNoteOff(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.
voidMidiControlChange(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.

Udon String/Image Loading Events

Return typeNameDescription
voidOnImageLoadSuccess(IVRCImageDownload result)Triggered when an image download succeeds. See Image Loading.
voidOnImageLoadError(IVRCImageDownload result)Triggered when an image download fails. See Image Loading.
voidOnStringLoadSuccess(IVRCStringDownload result)Triggered when a string download succeeds. See String Loading.
voidOnStringLoadError(IVRCStringDownload result)Triggered when a string download fails. See String Loading.

Unity Events

These are the method stubs available for Unity events. Unity MonoBehaviour Documentation

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