So in my current project, I am using the basic simplemove script until I write my own.
This seems to cause a lot of issues for some people who have tested my game
The movement works for me, but some of my friends have said that trying to move forward will make them move vertically.
Any ideas of why this would even happen?
Here is a link to the webplayer version if anyone would like to post their results.
http://brookeblood.com/My%20Website.html
Beennn
February 15, 2013, 4:34am
2
Does the script use Rigidbody.AddForce ?
Nope, here is the script.
var speed : float = 3.0;
var rotateSpeed : float = 3.0;
function Update () {
var controller : CharacterController = GetComponent(CharacterController);
// Rotate around y - axis
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
// Move forward / backward
var forward : Vector3 = transform.TransformDirection(Vector3.forward);
var curSpeed : float = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward * curSpeed);
}
@script RequireComponent(CharacterController)
Is there a better script for a car? Or should I make my own?
Beennn
February 15, 2013, 5:27am
4
I wouldn’t use that for a car game; have a look here . If you’re wanting to keep it simple, I wouldn’t recommend it however you could stick with what you have and freeze the position of the gameObject along the y axis, you might also want to freeze the rotation along the x and z axis.
Thanks! I was able to fix my current script, but I’ll look into that tutorial.