- Home /
Free floating first person camera
The premade first person camera prefab only offers 360 degrees of vision. How do i edit it so instead of the mouse going off screen to turn 180 degrees left, its as if the whole body turns 180 degrees and the mouse stays on the screen as in most first person shooters. Can i edit this in the free version of unity?
Answer by Eric5h5 · Mar 08, 2010 at 09:23 PM
With the first person controller prefab, it doesn't actually matter where the mouse pointer is; it still reads relative mouse movement regardless. You can use Screen.showCursor to hide/unhide the mouse cursor if you like. There's also Screen.lockCursor, which will lock/unlock the mouse cursor to the center of the screen.
Answer by Cyclops · Mar 10, 2010 at 08:38 PM
While I bow to the expertise of Eric5h5, :) I did want to add something, specifically to the question about editing the script files. Which you can easily do, in any version of Unity. If you look in the Projects tab, under Standard Assets->Camera Scripts, you'll see MouseLook. This is the script attached to the Camera in the FPSController, and you can edit it just like any script.
Note that you will be editing the copy of the script that was installed under your current Projects directory, so any new projects would not have your changes.
The main thing I changed in mine, is to set rotationY * -1, to invert the mouse. Otherwise it drives me nuts... :)
@Cyclops I would suggest to you stop using a signature and a quote.. cause this is not a forum-like site.. and you can change your username to something else if you want to sign differently :)
@Lipis, okay, I'll remove it, just for you - and because you didn't mod me down for it :) Seriously, you're right, I hadn't thought about it, just a reflex to have a sig. Wups.
@Cyclops forgot to upvote this one.. since I missed your comment... :)
Your answer
![](https://koobas.hobune.stream/wayback/20220612101340im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Klick a Button to Fly from A to B. 1 Answer
First Person Camera switch to Third Person Camera on Object 2 Answers
How to make two cameras face the same direction? 1 Answer
How to make an equipped axe charge up to a swing when moving camera? 0 Answers
1st person Camera rotates suddenly in another direction when unparenting from a platform 1 Answer