So im trying to change camera using left click on mouse with a specific weapon but i want it only when on click. and when its not it goes back to the main camera. such as when the map is enabled and when i left click a minimap will show up. How do i code that.
at the moment this is the code i have. is there something i should add. i apologize since im really not good with codes
if (app.keyboard.wasReleased(pc.KEY_1) ){
app.root.findByName("torch").enabled = true;
app.root.findByName("map").enabled = false;
}
if (app.keyboard.wasReleased(pc.KEY_2) ){
app.root.findByName("torch").enabled = false;
app.root.findByName("map").enabled = true;
}