|
I am using the basic FPS Camera Mouse script, that came with Unity. Is there something I can add to this script that I can make the view look around only when the Mouse Button is held down and the mouse is moved. Right now the camera moves around all the time when the mouse is moves. Thanks. [AddComponentMenu("Camera-Control/Mouse Look")] public class MouseLook : MonoBehaviour {
}
(comments are locked)
|
|
http://unity3d.com/support/documentation/ScriptReference/Input.GetMouseButton.html just don't execute anything like calculating the rotation or the actual rotation if it returns true so just put everything in the Update function above into a big if statement Can You show me where in the code to put /button/ values are 0 for left button, 1 for right button, 2 for the middle button. I am still new to scripting thanks
Sep 02 '10 at 04:42 PM
Dan Jimenez
It's set up by default - 0 is Left Mouse Button, 1 is Right, 3 is Middle (I believe). So you can just put Input.GetMouseButton(0) and it means left click.
Sep 02 '10 at 07:38 PM
Jason_DB
thanks Matyi, your solution worked for me.
Oct 20 '10 at 02:16 PM
nom-t
(comments are locked)
|
