- Home /
How to change the first person controller speed?
I am quite new to Unity, and I would like to know how to change the first person controller speed so that it can move faster? I built a terrain that is 2000x2000, and the first person controller is moving very slowly. I also want the player to be able to go upward and downward when they are looking up or down, like floating. I am looking at addforce. But I am not sure how to write it. I have:
pragma strict
var controllerScript = gameObject.GetComponent("FirstPersonController");
function Start () {
}
// Adds a force upwards in the global coordinate system function Update () {
controllerScript.maxForwardSpeed = 1;
rigidbody.AddForce (Vector3.up * 100);
}
Answer by thinksecretly · Mar 27, 2013 at 11:58 PM
if i am understnding you correctly, all you need to do is change the max speeds on the character motor in the inspector to make the first person controller go faster.
Answer by KMKxJOEY1 · Mar 27, 2013 at 11:57 PM
click into your character controller and click on the Character Motor script then click on the arrow next to movement adjust the values to what you like
as for moving in the direction you are facing, you may have to make your own controller script, as the included ones are for 'people' like controllers
Answer by AlucardJay · Mar 28, 2013 at 05:38 AM
Here is an excellent script by Aldo that shows how to access and send information to variables on the Character Controller. You do not need to modify the Unity controller scripts, just follow Aldos example and access and modify the variables that way : http://answers.unity3d.com/questions/164638/how-to-make-the-fps-character-controller-run-and-c.html
Answer by pnk314 · Oct 07, 2013 at 02:59 PM
Just change the Max Ground Acceleration to as much as you want, I would recommend about 50.