x


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?

more ▼

asked Jan 11 '11 at 07:56 PM

TinyUtopia gravatar image

TinyUtopia
270 22 26 38

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Jan 11 '11 at 07:59 PM

Jessy gravatar image

Jessy
15.6k 72 95 196

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2994
x291
x237
x179
x30

asked: Jan 11 '11 at 07:56 PM

Seen: 1863 times

Last Updated: Jan 11 '11 at 07:56 PM