- Home /
Insert First Person Controller, but can not move in Game view
i am a newer for unity, and this is my first project with the problems of first person controller.
when i started with a project from tutorial, building a cube (x=100, y=1, z=100), than i delete main camera in Hierarchy. i put first person controller into scene view, on the cube, and want to see what happened. in game view, i could not move, look around, or jump. there is an error below
"NullReferenceException: Object reference not set to an instance of an object FirstPersonControl.Update () (at Assets/Standard Assets (Mobile)/Scripts/FirstPersonControl.js:64)"
i don't know what happen, it is just a simplest project.
my computer is macbook, and osx 10.5, unity 3d 3
thank for your help.
thank you everyone, i fixed it up. i change the standard assets mobile to one without mobile and it works.
i have oly the standard assets mobile .. how do i change it to normal one pls help
@Purusoth$$anonymous$$ You need to import the "Character Controller" package.
I dont have the character controller package anywhere in my finder
@jhalt9 it isn't in your Finder. Use the menu item Assets->Import Package->Character Controller.
Answer by Jopsy · Nov 10, 2010 at 10:35 AM
I think that you are going into the Window panel and clicking game, which you shouldn't do... Just press ctrl+p and it should work... ;)
Answer by Ostagar · Nov 11, 2010 at 01:28 AM
Assets/Standard Assets (Mobile)/Scripts/FirstPersonControl.js:64
You're using the (Mobile) assets and that's probably not what you want just now. Try Standard Assets / Character Controllers / First Person Controller and everything should work okay. :)
The standard First Person Controller prefab actually requires several parts--a Character Controller physics component, a Character Motor script, and an FPSInputController script. It's often used with an optional Mouse Look script. The prefab comes packed with everything so you can see how it works... then transfer the parts you need over to the GameObject you actually wanted to control.
Answer by StephanK · Nov 10, 2010 at 08:58 AM
It means that a in line 64 of the FirstPersonControl script you have an unassigned variable. I don't know what's in line 64, but maybe you could post the code. (not the whole script, just the relevant parts) As a quick check you could look at the inspector for the FirstPersonControl script and see if there are any variables set to "none".