Confusion between similar functionality: ActionManager vs CameraInput; Physics Engine vs Built in collision

There’s quite some question related to ActionManager already, I am sorry to bring out yet another one.

My problem is described as titled.

I’ve followed through a set of tutorials and implemented event listeners in BABYLON.ICameraInput<T>, then in another tutorial I saw Scene.ActionManager.
My main concern is when to use which, or more specifically, use case of BABYLON.ICameraInput<T>. Maybe the ability to detach and attach? Or is it just a design choice?
I feel like they are interchangeable, both use addEventListener somewhere, ActionManager handles input in the main render loop, ICameraInput.checksInput probably also run once every loop.

and the other thing, collision/gravity etc.
You can set Scene.gravity, Mesh.checkCollisions, Mesh.moveWithCollisions, etc
on the other hand, physics engine provided these with Scene.enablePhysics(gravity), Mesh.physicsImpostor, Mesh.applyImpulse, etc

My question is do they interfere, for example, does Mesh.checkCollisions check the collisions with the Mesh.physicsImpostor. Without extensive testing I feel like they aren’t related, if they are really not related then my other question is, again, when to use which, or is it fine for me to drop Mesh.checkCollisions & moveWithCollisions completely and use physics engines-related method instead?

Sorry for the long question, thank you.

So physics is to simulate physics between meshes (real world physics) and collisions are for the camera vs the world (initially done to create FPS camera for instance)

Camera inputs are used to control the camera (they are various sorts like keyboard, touch, gamepad, etc)
==> Customize Camera Inputs - Babylon.js Documentation

ActionManager is a powerful tool to chain actions based on triggers
==> Use Actions - Babylon.js Documentation

Does it help a bit?

1 Like

I’ve read both pages before, and this is exactly where the confusion arises when I encounter this page - animatedcharacter (and Device Source Manager is coming too).

Thanks, it does help after I cleared my mind after a walk,
1st person camera is nice to use collisions and CameraInput for keyboards input,
while it’s better to use others for most other camera type.

Thank you.

1 Like