- Home /
Multiple Camera.main.ScreenPointToRay
I am raycasting for collision objects using the command
Camera.main.ScreenPointToRay
This works fine when I am using only one camera with the CameraMain tag. How do I continue to use screen raycasting when I have several cameras that are being switched in the scene?
Answer by Jessy · Jan 11, 2011 at 07:59 PM
Camera.main can only refer to one camera(*) Unity will grab the first camera it finds with that tag. Use a different way of referencing them than Camera.main. An array is probably a good bet.
(*) One active camera. But I assume you can't disable the other cameras, if you haven't had luck with that loophole yet.
Your answer
Follow this Question
Related Questions
What effects/controls a ScreenPointToRay() ray? 1 Answer
Add multiple cameras problems 1 Answer
Switching Several Cameras(HorrorGame) 1 Answer
Switching cameras with the mouse button 1 Answer
UI Buttons switch cameras 3 Answers