Hub.Listen as a Trigger for Action Managers

This is my first time using the Action Manager, and I’m really liking the simplicity of using it; however, I was wondering if there is a way I can use a different triggers other than the list here. A post on Auto-Play actions said to call the function directly, but I’m not sure what @Deltakosh meant by that.

Here’s a playground attempting that:
https://playground.babylonjs.com/#S82Y0B#2

The trigger is an OnPickTrigger, which is working, but I’m wanting to change it to a different trigger, such as Hub.Listen, so I don’t have to rely on a cursor or intersection event to run this action.

Actually I meant something like that:
https://playground.babylonjs.com/#S82Y0B#3

sphere.actionManager.processTrigger(BABYLON.ActionManager.OnPickTrigger)

2 Likes

Yup! That’s exactly what I was looking for thank you!