Arc Camera Collision

How to add the collision to Arc camera so that Arc camera will not enter into the wall of the meshes?
Thank You

1 Like

See:

1 Like
//at scene level
scene.collisionsEnabled = true;

//for the camera
camera.checkCollisions = true;

//check collisions for all visible meshes
for (var i = 0; i < scene.meshes.length; i++) {
    if(scene.meshes[i].isVisible == true){
    scene.meshes[i].checkCollisions = true;
    }
}

Also note that collisions are checked only on the frontface of a mesh, clone or instance.
And then although I just gave you the script, I can only recom you would take a quick tour of the link shared above for a better understanding. Meanwhile, have a great day :sunglasses:

2 Likes