Zoe for Unity: Help Center
  • Zoe for Unity - Help Center
  • Installation
    • Setting up Unity
    • Installing Zoe
    • XR Settings
    • Basic Scene
  • Getting Started
    • Interaction Rig
      • Create an Interaction Rig
      • Structure & Settings
    • Testing without a headset
    • Navigation modes
  • Adding interactivity
    • Overview
    • Interactive Objects
      • Creating IOs
      • Structure of IOs
      • IO Setup
    • Interactions
      • Interaction Setup
      • Conditions
        • Duration (parameter)
        • Gaze
        • Point and Click
        • Proximity
        • Touch
        • Manipulate
        • Inputs
        • Drop
        • Approach
        • Collision
      • Actions
        • Delay (parameter)
        • Scale
        • Rotate
        • Rotate Around
        • Translate
        • Activate
        • Audio
        • Animation
        • Physics
        • Change Material
    • Drag & Drop system
    • API - Custom Scripts
      • Create your own Condition
      • Create your own Action
  • Multiplayer
    • Installation
    • Photon Setup
    • Scripting Symbols
    • Get Started
    • Avatars
    • Multiplayer Conditions
    • Multiplayer Actions
  • Exporting Your App
    • Exporting your .apk for Quest
    • Sideloading your .apk on Quest
  • Lessons
    • Getting Started
      • Interactive Objects
      • Actions 01
      • Actions 02
      • Conditions 01
      • Conditions 02
  • MX PEN INTEGRATION
    • Installation
    • MX Pen Input Mapping
    • Changing the default MX Ink Visual
  • Swapping the MX Inc Visual In Play Mode
Powered by GitBook
On this page
  1. Adding interactivity
  2. API - Custom Scripts

Create your own Action

We explain here the basics of implementing a new Zoe ACTION with your own code:

Find the script TemplateAction in your Project window (under Scripts > Interactions > Actions) duplicate it and rename the duplicated file with your action name [YourActionName]. Once this is done, open the file for editing.

Rename the class name from:

public class TemplateAction : S_AbstractAction

to

public class [YourActionName] : S_AbstractAction

IMPORTANT: the name you gave to the file and the name of the class need to be the same.

You can then code what you want to happen when the action triggers inside the ActionLogic function where the comment says ‘Implement your action logic here’.

You can then use your custom ACTION inside any Interaction through the Add Component menu.

Last updated 2 years ago