spritefire Posted January 31, 2015 Share Posted January 31, 2015 If I have 6 lights (3 enabled at the start) and then I have a mesh interact with another mesh how would I get it to act like a light switch and turn off one set and enable another set?it's 7am and my brain isn't working anymore. I've tried: scene.cube1.actionManager = new BABYLON.ActionManager(scene); scene.cube1.actionManager.registerAction(new BABYLON.ExecuteCodeAction({ trigger: BABYLON.ActionManager.OnIntersectionEnterTrigger, parameter: scene.sphere }, lightsOn("switchOne"),true)); scene.cube1.actionManager = new BABYLON.ActionManager(scene); scene.cube1.actionManager.registerAction(new BABYLON.ExecuteCodeAction({ trigger: BABYLON.ActionManager.OnIntersectionEnterTrigger, parameter: scene.sphere }, lightsOn("switchTwo"),true));and having a lightsOn function call one set enabled and the other disabled (depending on what is passed through the function)ie light1.setEnabled(0); light2.setEnabled(0); light3.setEnabled(0); light4.setEnabled(1); light5.setEnabled(1); light6.setEnabled(1);can't seem to get it to work.. Quote Link to comment Share on other sites More sharing options...
spritefire Posted January 31, 2015 Author Share Posted January 31, 2015 found a thread that had the answer I was looking for just after I posted this http://www.html5gamedevs.com/topic/8251-action-manager-and-onintersectionentertrigger/works now. Now time for sleep Quote Link to comment Share on other sites More sharing options...
gryff Posted January 31, 2015 Share Posted January 31, 2015 Don't forget spritefire that you have the ability to includedOnlyMeshes and excludeMeshes. The Babylon Village scene I created has 7 lights all on at the same time - a Hemi light that illuminates the whole scene and 6 Point lights that illuminate only certain areas and meshes cheers, gryff Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.