Scripting

Search The Documentation:

  1. Home
  2. Docs
  3. Scripting
  4. Built-In Functions
  5. onClick

onClick

Platform Compatibility

PC Mac OSX Oculus Quest
X X X

onClick triggers whenever the object is clicked on with a mouse or a VR hand trigger

Parameters:

  • type
    • An integer value between 0 and 4
      • 0 – Left click
      • 1 – Left hand trigger (VR)
      • 2 – Right hand trigger (VR)
      • 3 – Right click
      • 4 – Middle click
      • 5 – Gamepad left trigger
      • 6 – Gamepad right trigger

Example:

1
2
3
function onClick(type)
    obj.set3DText("You Clicked Me With: " .. type)
end
Tags
Was this article helpful to you? Yes No

How can we help?