- Home /
Mapping camera heading to arrow keys
Hello all,
I am a visual designer and I am trying to find my way into a bit of the unity engine. I am trying to put the things that I create in cinema 4D into a virtual environment and walk though it. But the camera script that is standard in Unity (the First Person Controller) is unsuitable for casual walk throughs. I searched the web for smooth camera in Unity and found an entry at this link to newarteest.com/unity And what I found there was exactky what I would expect of a camera to act like (turning with the arrow keys and only looking with click-and-drag movement.
How could I achieve this? I looked in the input manager but could find no reference to heading and pitch axes there...
ALBERT KIEFER visual designer http://www.kiefer.nl
It would be helpful if you posted the code you are currently working with...
Answer by WAP-Tek · Sep 23, 2010 at 05:51 AM
i think my question and yours are related http://answers.unity3d.com/questions/21159/am-i-missing-the-in-game-key-settings-preference-strafe-vs-turn
if i get a response i will post to your "Q"
i think this is a z axis setting,, for lack of a better term I found the main area for setting built-in game key mappings in the input manager at
http://unity3d.com/support/documentation/Components/class-Input$$anonymous$$anager.html
Answer by WAP-Tek · Sep 24, 2010 at 07:30 AM
skip it!
I found out unity3d installs the p@ce "bot" and then hides that it did it, , no notification, no opt out , just the same old same old
now i have to do a cleanup to get it out of the driver stack this reeeealy makes me mad ,,
Answer by Design3.com · Jan 20, 2011 at 11:36 PM
In the Input Manager you can define an input axis (call it "Turn" or "Horizontal") and map the A and D keys to the axis' negative and positive triggers. When A is down the axis will be -1, when D is down the axis will be 1, otherwise it will be 0. You can use those values to rotate your player object in an Update function.
Put this in a script attached to the game object that holds your Character Controller component:
var turnSpeed : float = 2.0;
function Update() { transform.Rotate(Vector3(0, Input.GetAxisRaw("Horizontal") Time.deltaTime turnSpeed, 0)); }
Your answer
Follow this Question
Related Questions
Space Flying Script Using Mouse 1 Answer
GUI controlled by keyboard 4 Answers
the keyboard on iPad 2 does not get dismissed 4 Answers
Android 4.0 ( ICS ) Keyboard issue 2 Answers