Multiple Actions with ActionManager

Hello , please i have some problem with ActionManger to make muliple action .

I need to put the material level to 5 + rotate the mesh when i click on the mesh in the first time .

And reset the values of ( the material level + rotation ) in the second time .

I try some function but isnt work :

https://www.babylonjs-playground.com/#8LFTCH#194

Thanks again !

Seems like you are applying two rotations on the same object. Is that what you wanted to do?
Multiple actions do work - https://www.babylonjs-playground.com/#8LFTCH#195 (i changed the second rotation to position just for the demo).

If you want to run a few functions with one action you can always use the executeCodeAction which will simply execute a function that you define when this action was executed. If you want to manipulate a different object, choose the other object as the target of your action.

1 Like

Thanks for response but it is not i am asking for .

I need to execute multiple function like rotation and position with same function .

Do you mean in sequence? one after the other? so every pick a different function will be executed?

Like false and true when you click on it !

there is always PointerDown and PointerUp, if that’s what you mean

1 Like

I find this way to make it , but how i can make multiple action in the first click ?

mesh.actionManager.registerAction( new BABYLON.InterpolateValueAction(
BABYLON.ActionManager.OnPickTrigger,
light,
‘diffuse’,
BABYLON.Color3.Black(),
1000
)
)
.then( new BABYLON.SetValueAction( BABYLON.ActionManager.NothingTrigger,
mesh.material,
‘wireframe’,
false
)
);

Could you not rely on the CombineAction ???

So you can trigger several actions at once.

1 Like

Thanks You !