Hey all,
I’ve been trying to add either a ValueCondition or a PredicateCondition to an action that I’m developing, such that said action can only be executed under the condition that I set. However, when I try to define the action (ExecuteCodeAction in this case) I get the following error:
Argument of type 'AbstractActionManager' is not assignable to parameter of type 'ActionManager'.
Type 'AbstractActionManager' is missing the following properties from type 'ActionManager': _scene, getScene, _getEffectiveTarget, _getProperty
The overall logic of my code is as follows:
scene.actionManager = new BABYLON.ActionManager();
let condition = true;
const act = new BABYLON.ExecuteCodeAction(
{
trigger: BABYLON.ActionManager.OnKeyDownTrigger,
parameter: "r"
},
() => {
//code to execute when action "r" is pressed
},
new BABYLON.PredicateCondition(scene.actionManager,
() => {return condition;})
);
I replicated the issue in this Playground, where I tested both the sphere’s and scene’s actionManagers, to no avail. It seems like both of these are declared as AbstractActionManagers
? The examples here don’t seem to address the declaration for the ActionManager, so I’m at a loss.
Any help will be appreciated!