Need help with scripting

Hello. I’m new at Unity 3D and I try to make some game by watchinng tutorials for begginers. And now I have error on one of the lines, I dont know how to explain that and hot to fix that. Please help me if you can :).

Sorry for my bad english

There is a photos of my script and Unity error.

there is a } in the requirecomponent line that should not be there

I deleted it, but it still writing ‘‘error CS8025: Parsing Error’’ … :confused:

can you paste your whole script? I think you forgot to close a bracket or something like that

using UnityEngine;
using System.Collections;

[RequireComponent (typeof(CharacterController))]
public class FirstPersonController : MonoBehaviour {

public float movementspeed = 5.0f;
public float sidespeed = 3.0f;
public float UpDownRange = 60.0f;
public float mousespeed = 2.0f;
public float jumpSpeed = 2.0f;

float verticalRotation = 0;

float VerticalVelocity = 0;

CharacterController characterController;

// Use this for initialization
void Start () {

Screen.lockCursor = true;
CharacterController characterController = GetComponent ();
Debug.Log(characterController);

}

// Update is called once per frame
void Update () {

//rotation

float rotLeftRight = Input.GetAxis (“Mouse X”) * mousespeed;
transform.Rotate (0, rotLeftRight, 0);

verticalRotation -= Input.GetAxis (“Mouse Y”) * mousespeed;
verticalRotation = Mathf.Clamp (verticalRotation, -UpDownRange, UpDownRange);
Camera.main.transform.localRotation = Quaternion.Euler (verticalRotation, 0, 0);

//movement

float forwardSpeed = Input.GetAxis(“Vertical”) * movementspeed;
float sideSpeed = Input.GetAxis(“Horizontal”) * sidespeed;

VerticalVelocity += Physics.gravity.y * Time.deltaTime;

if( characterController.isGrounded Input.GetButtonDown(“Jump”) ) {
VerticalVelocity = jumpSpeed;

}

Vector3 speed = new Vector3 ( sideSpeed, VerticalVelocity, forwardSpeed );

speed = transform.rotation * speed;

characterController.Move( speed * Time.deltaTime );
}
}

Maybe you will find something here? :).

I didnt get any parsing error but CharacterController characterController was being defined twice so I just removed one and the code below works

using UnityEngine;
using System.Collections;
     
[RequireComponent (typeof(CharacterController))]
public class FirstPersonController : MonoBehaviour
{
	public float movementspeed = 5.0f;
    public float sidespeed = 3.0f;
	public float UpDownRange = 60.0f;
	public float mousespeed = 2.0f;
	public float jumpSpeed = 2.0f;
	float verticalRotation = 0;
	float VerticalVelocity = 0;
	CharacterController characterController;
	
	// Use this for initialization
	void Start ()
	{
		Screen.lockCursor = true;
		characterController = GetComponent <CharacterController> ();
		Debug.Log(characterController);
	}
	
	// Update is called once per frame
	void Update ()
	{
		//rotation
		float rotLeftRight = Input.GetAxis ("Mouse X") * mousespeed;
		transform.Rotate (0, rotLeftRight, 0);
		verticalRotation -= Input.GetAxis ("Mouse Y") * mousespeed;
		verticalRotation = Mathf.Clamp (verticalRotation, -UpDownRange, UpDownRange);
		Camera.main.transform.localRotation = Quaternion.Euler (verticalRotation, 0, 0);
		
		//movement
		float forwardSpeed = Input.GetAxis("Vertical") * movementspeed;
		float sideSpeed = Input.GetAxis("Horizontal") * sidespeed;
		VerticalVelocity += Physics.gravity.y * Time.deltaTime;
		if(characterController.isGrounded  Input.GetButtonDown("Jump"))
		{
			VerticalVelocity = jumpSpeed;
		}
		Vector3 speed = new Vector3 ( sideSpeed, VerticalVelocity, forwardSpeed );
		speed = transform.rotation * speed;
		characterController.Move( speed * Time.deltaTime );
	}