Zareh

Members
  • Content count

    1
  • Joined

  • Last visited

  1. Collission

    Hello I am new in this, I am working on a project for the college. I am trying to make an elevator when i am inside the elevator and the elevator floor goes up it wont detect the camera to push the camera up. my collissions are enabled and is working fine i can detect obstacles when I move the camera(Freecamera) with the keyboard. and i can step up on the floor of the elevator. but when I Have a moving object and it hits the camera it doesnt detect the obstacle. (elevator floor in my case). the link of my code is below. I am sorry the code is terribly arranged. the script: https://drive.google.com/open?id=1BSs2BB0Ns9BDmwLSyePiqHtKEBHM9F91 The whole project: https://drive.google.com/open?id=1xm0JyQXJY2yD-wck9Y3bs5tKcg01LYRI Thanks a lot scene.collisionsEnabled = true; camera.checkCollisions = true; camera.applyGravity = true; camera.collisionRadius = new BABYLON.Vector3(2, 2, 2); camera.ellipsoid = new BABYLON.Vector3(1, 4.5, 1); var elevupfun = function (mesh2,mesh4,mesh5,mesh6) { var posopdor1 = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, mesh4, "position",new BABYLON.Vector3(11.625, 7.625, 35.5), 200); var scalopdor1 = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, mesh4, "scaling", new BABYLON.Vector3(0, 1, 1 ), 200); var posclosdor1 = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, mesh4, "position",new BABYLON.Vector3(13.5, 7.625, 35.5), 200); var scalclosdor1 = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, mesh4, "scaling", new BABYLON.Vector3(1, 1, 1 ), 200); var posopdor2 = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, mesh5, "position",new BABYLON.Vector3(19.125, 7.625, 35.5), 200); var scalopdor2 = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, mesh5, "scaling", new BABYLON.Vector3(0, 1, 1 ), 200); var posclosdor2 = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, mesh5, "position",new BABYLON.Vector3(17.25, 7.625, 35.5), 200); var scalclosdor2 = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, mesh5, "scaling", new BABYLON.Vector3(1, 1, 1 ), 200); var elevup = new BABYLON.InterpolateValueAction(BABYLON.ActionManager.OnPickTrigger, mesh6, "position",new BABYLON.Vector3(15.25, 30.1, 40.0625), 4000); mesh2.actionManager.registerAction(posclosdor1); mesh2.actionManager.registerAction(scalclosdor1); mesh2.actionManager.registerAction(posclosdor2); mesh2.actionManager.registerAction(scalclosdor2); mesh2.actionManager.registerAction(elevup); } elevupfun(elevinsidebutton,elevatordoor1L,elevatordoor1R, elevground);