|
I have a sniper rifle which is a child object of the main camera on fps controller and then I have a camera which is a child object of the sniper rifle. What I want to do is when you click the right mouse button, you go from looking through the main camera to looking through the other camera, and when you click the right mouse button again you switch back to looking through the main camera. Can anyone help me with this?
(comments are locked)
|
|
Twist answer- only have one camera! Then, have two transforms which are managed separately- one on the scope, and one for the main character. Treat these transforms the same way you would use a camera in terms of movement etc., and then when you want to change camera, do this- can you explain what a transform is please?
Oct 28 '11 at 01:17 PM
Dreave
Can you explain how you've been working with unity for any amount of time without knowing what a Transform is?
Oct 28 '11 at 11:48 PM
syclamoth
Oct 29 '11 at 01:11 AM
oxium
oh right I thought it was something else, sorry about that. How do I add another transform? Please help
Oct 29 '11 at 09:15 AM
Dreave
Only one transform per object, sorry. On the other hand, if you create a new 'empty' object, it comes with a Transform as a free bonus!
Oct 30 '11 at 02:44 AM
syclamoth
(comments are locked)
|
|
use a lerp: http://unity3d.com/support/documentation/ScriptReference/Quaternion.Lerp.html and assign the result quaternion to your camera
(comments are locked)
|
