Hi, I'm new to this Unity, and I tried to put a first person controller on my terrain, and it wont move, no matter what I do. It is the one that comes with unity when you download it. I have the free version. And I have no understanding of scripts yet. But no matter what I do, I simply cannot get my person to move. I can get it to look around, but not to move. Please help!
7 Answers
7The Default Input is MOBILE devices.
I have added one line in the FirstPersonController.cs at the end of Start Method:
CrossPlatformInputManager.SwitchActiveInputMethod (CrossPlatformInputManager.ActiveInputMethod.Hardware);
This fixes the problem
Select FPSController from hierarchy -> Find First Person Controller from inspector -> Select Edit Script by clicking the setting gear (Script will open in new window) -> find Start Method and insert : CrossPlatformInputManager.SwitchActiveInputMethod (CrossPlatformInputManager.ActiveInputMethod.Hardware); at the end.
– vigneshhp200Welcome to Unity =)
You can go to Standard assets -> Character controllers -> Sources -> Scripts.
You should see a JavaScript file called CharacterMotor.
Drag that to your main camera in the hierarchy window. (Your main camera is the one that when you click play, your view goes to it.)
After that, you can click on your main camera and see on the right side the inspector and scroll down. Below should have some attributes; play around there to get the result you want in the end.
Go ahead and ask more questions - its a good way to learn, especially in this community. =)
Thanks for the quick answer! Sadly, this did not help my issue, though it's good to know where to tweak the FPS character should things work normally. Is there any sort of incompatibility issue that I may not be aware of perhaps? I'm using Windows 8, and I'm running Unity 4. And just a reminder: Neither the First Person nor the Platformer "characters" move. They just stand there doing nothing. In builds made by other people, I CAN move around and jump. BUt nothing I do makes it move.
– shiheWanted to add as comment, but not enough rep I guess…
To add to massimoatcatnicdotit’s answer… if you have your build platform set to Windows Store, it defaults to a compiler define of MOBILE_INPUT, so you can either modify the script as stated, or under player settings, other settings panel, remove MOBILE_INPUT from “Scripting Define Symbols”.
This has helped me for using the controller for prototyping Windows Store builds. In the long run I’ll either have to use a different controller, or mod this one to correctly support today’s modern world of mix/match of all kinds of input (i.e.-on my Windows tablet I often play games with a mix of touch and mouse input, sometimes even have my USB keyboard attached as well – not to mention desktops with touch input).
this is the best answer! For me it was a Windows Store game that had the issue and this suggestion worked beautifully. THANKS!
– ImperialDynamicsI had the same issue and now sorted. This is how it is done. Click on file\ new project then select Character Controller.unity pakage. Then add a terrain to the project then drag a first person controller, press play button and it should move nicely.
This is just a case when you build game for android platform…you would need to make some changes in the first person controller script … If you wish to make it into the pc platform then just switch the platform to pc mode from file menu… Best of luck.
Thank a lot, It helped me, I made these changes "File->Build Settings->select PC,Mac and Linux stand alone" click on switch platform
– B_MadhukarAlso, make sure all of your movement speeds aren’t set to 0. This was my embarrassing problem.
I had this weird issue when after starting the game the mouselook worked but the walking didn’t. (on Linux). Tried everything in the forums - no good. Even the mouse pointer was gone after esc-ing.
Turned out I had to put the focus into the play window and then start the game by Ctr-P from there.
Hope this helps anyone.
I converted your answer to a comment. Answers should only be used to reply to the main question
– ExTheSeaI have the same issue, none of the answers I've found worked for me. It would be nice to know if this is a bug, which appears to be.
– fedesilvaponteI've just seen your comment and does make sense. but unfortunatelly i'm quite new to programming and I don't understand your method. How does the static method make the audio not stop when changing scenes. Could you please explain. Thanks.
– toolsboy