Broken scripts(need help fixing)

Hi, I have some scripts here I got from a website, and they are broken by syntax errors. I was wondering if anyone would help me fix them. Whenever I add a script to my player, the script never shows the local variables for the movement speed. Could anyone help me, I’m new.

MOVEMENT…

var speed : float = 6.0;
var jumpSpeed : float = 8.0;
var gravity : float = 20.0;

private var moveDirection : Vector3 = Vector3.zero;

function Update() { var controller : CharacterController = GetComponent(CharacterController); if (controller.isGrounded) { // We are grounded, so recalculate // move direction directly from axes moveDirection = Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")); moveDirection = transform.TransformDirection(moveDirecti­on); moveDirection *= speed; if (Input.GetButton ("Jump")) { moveDirection.y = jumpSpeed; } } // Apply gravity moveDirection.y -= gravity * Time.deltaTime; // Move the controller controller.Move(moveDirection * Time.deltaTime);
}

SHOOTING

var Bullet:Transform;

var ShootingForce = 100.0;


function Update () {
if(Input.GetButtonDown("fire"))
{
var fire = Instantiate(Bullet, transform.position, Quaternion.identity);
fire.rigidbody.AddForce(transform.right * ShootingForce);
}
}

The first script needs reformatting…the long line that’s in red is mostly commented out, and many parts are needed to NOT be commented. Find the script again and get it formatted right, that’s the source of most of your errors. I tried a reformat below to save you the hassle, but it’s hugely important that you learn how the brackets etc. work, otherwise you’ll never get far with scripting…takes time but is worth it!

Not sure if naming the bullet “fire” is a good idea, because that’s the same as the GetButtonDown. Maybe it’s not a problem though.

And you do need “var” in the “var fire” line, otherwise you’ll get an error…without it, unity assumes you’ve created that variable already.