Search Knowledge Base by Keyword

Create your own Condition

Zoe has a modular structure allowing you to create your own scripts in combination with the whole system. We explain here the basics of implementing a new Zoe CONDITION with your own code:

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

Rename the class name from: 

public class TemplateCondition : S_AbstractCondition

to:

public class [YourConditionName] : S_AbstractCondition

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

The whole logic of a condition revolves around calling the Validate function to tell the system your condition has been validated. Outside of the functions you see in the template, you will need to implement your own logic that will call Validate based on some requirements you defined.

You also need to fill up the three functions Setup, Dispose and Reload with logic.

Setup will be called before your condition is actually checked for validation. Use this function to prepare the things required for its validation.

Dispose is basically the opposite of Setup and somewhat undoes what was done in setup so that the condition does not accidentally validate again.

Typically the Setup and Dispose are usually called in a loop if your condition is reloaded several times.

Reload can have some custom logic of your choosing, but it is usually solely made for calling Invalidate which simply tells the system the condition is now ready for validation again.

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

Previous Collision
Table of Contents

Copyright Zoe 2020, All rights reserved. Zoe is a product of apelab, Inc. Let's empower the next generations of XR makers! apelab.io