- Home /
Changing the Camera Control
In Unity 4.0 I would like to know how to edit the First Person Controller asset that comes in the package provided with Unity. I would like the player to be able to still move around with the ARROW KEYS, but instead of using the mouse to 'look around' I would like to know how to make it so you use the W,A,S+D keys to do this (W tilts the view up, A to the left, D to the right and S downwards). Also I would like it so the mouse does not move the view around. Any help is much appreciated. Thank you.
goto components --> camera control --> select "mouse look"
Answer by Benjamin6817 · Dec 01, 2012 at 06:29 AM
Well, there are many ways to do that. I would recommend you remove the MouseOrbit script. Then I would make another one.... I would probably if the user presses W -> increase Y axis if the uses presses S -> decrease Y axis, if user presses D increase X axis, etc., you get the point. There's no hard math in it.
Answer by KurtBexley · Dec 02, 2012 at 11:46 AM
Thank you Ben, however Im completely new to javascript although I know a few functions I'm used to coding in GML. How do I detect a key press and change the camera's rotation?
Well, if you want to learn JavaScript I would point you here: http://wiki.unity3d.com/index.php/The_Absolute_Beginner%27s_Guide_to_Unity Like the article says, I directed you there because "You were trying to run before you can walk". When you're done with those tutorials and you still have the same question I would look at: http://docs.unity3d.com/Documentation/ScriptReference/Input.GetButton.html and http://docs.unity3d.com/Documentation/ScriptReference/Transform.Rotate.html
I'm not saying you're dumb or anything here. I just believe that you could really benefit from that article more than you could me writing you a script. If you're looking to be an artist, you're going to need some basic scripting knowledge anyways. I work on a project in a non-profit $$anonymous$$m and I have seen the artists write scripts to do basic things, rather than to bother the programmers and make them write a simple script that makes an enemy rotate when you press the "F" key or something.
Your answer
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
Unity camera troubles 1 Answer
Camera Control Help 0 Answers
character switching on collision 1 Answer
Camera frustums + custom field of view 2 Answers