Two Actions with One onClick

Two Actions with One onClick

How to add:

1.) Select the asset that you want to click in order to teleport your actor (in this case, it’s an item)

2) Add the command into the onClick section in the Properties panel

 

Syntax: [ {action1}, {action2} ]

Example:

[ {"action":"teleportActorToSpotTag","actorId":"1","spotTag":"hotspot2"}, {"action":"displayNotification","message":"Hello!"} ]

Possible problem:  there is no “onClick” section in the Properties panel

The onClick section is because a CAF (Custom Asset Field) has been created manually. If it is not present, you can add it to your cmp:

->Top toolbar, select “Project”

->Project settings

This box will pop up:

 

-> Click the “Custom Asset Fields” tab (1)

-> Click on the tab you want to add the CAF to (2)

(in this case it’s to an item, but you could add it to an actor, location, etc

depending on your needs for the scenario)

-> Click on the “Add New Field” button (3)

        -> Type in “onClick” (it’s case sensitive)

                -> Leave the Type as “text”

                        -> Click “OK”

Now the onClick CAF has been added, you can add in the command as explained earlier.

 

 

How useful was this article?

Click on a star to rate it!

We are sorry that this article was not useful for you!

Let us improve this article!

Tell us how we can improve this article?