OnMouseUp works only 1 time ...

Hello,

Using this script, the OnMouseUp function only works one time switching to the camera. When trying another time, nothing happens. It is placed on a sphere collider.

Reagrds,


var camPlayerD: GameObject;

function OnMouseUp () {

camPlayerD.active = true;
}

This script simply set the camera as active. If you have more than one camera active, I am not sure how Unity works. Try adding code for disabling other cameras when activating one… or maybe there is a way to set which of all the active cameras that should be the one displayed on screen. I am not so sure about this, maybe somebody else has better input.

If you add extra cameras to a scene, they will be created with a different depth setting. If you have more than one camera rendering at once, they will be displayed in order of the depth value (so if you have two cameras rendering fullscreen, one will completely overdraw the other). So, you generally should disable unwanted cameras whenever you enable a new one.

Wow, that is really important then… the FPS impact is huge if you accidently have more than one camera active. Thanks for the info!

Hello,

Thanks to both to help solve this issue.
I set the other cameras “.active” to false and everything is now fonctional and fluid in the camera switch.

Regards,