Script not working

My script is not working and i dont understand why :frowning: it says “The type arguments for method ‘Component.GetComponent()’ cannot be inferred from the usage. Try specifying the type arguments explicitly.”

The script is here

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[RequireComponent(typeof(CharacterController))]

public class Player : MonoBehaviour
{
public float Speed = 0f; //add these values in editor
public float JumpSpeed = 0f;
public float Gravity = 0f;
public Camera PlayerCam;
public float LookSpeed = 0f;
public float XLimit = 0f;

CharacterController characterController;
Vector3 moveDirection = Vector3.zero;
Vector2 rotation = Vector2.zero;

//optional
public bool canMove = true;

private void Start()
{
characterController = GetComponent();
rotation.y = transform.eulerAngles.y;
}

private void Update()
{
if (characterController.isGrounded)
{
Vector3 forward = transform.TransformDirection(Vector3.forward);
Vector3 right = transform.TransformDirection(Vector3.right);
float curSpeedX = canMove ? Speed * Input.GetAxis(“Vertical”) : 0;
float curSpeedY = canMove ? Speed * Input.GetAxis(“Horizontal”) : 0;
moveDirection = (forward * curSpeedX) + (right * curSpeedY);

if (Input.GetButton(“Jump”) && canMove)
{
moveDirection.y = JumpSpeed;
}
}
moveDirection.y -= Gravity * Time.deltaTime;

characterController.Move(moveDirection * Time.deltaTime);

if (canMove)
{
rotation.y += Input.GetAxis(“MouseX”) * LookSpeed;
rotation.x += -Input.GetAxis(“MouseY”) * LookSpeed;
rotation.x = Mathf.Clamp(rotation.x, -XLimit, XLimit);
PlayerCam.transform.localRotation = Quaternion.Euler(rotation.x, 0, 0);
transform.eulerAngles = new Vector2(0, rotation.y);
}
}
}

GetComponent(); needs to be GetComponent<CharacterController>(); otherwise it has no idea what type of component to get, as the error is implying.

What Praetor says above, but also keep this in mind:

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

How to understand compiler and other errors and even fix them yourself:

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly

Also, consider this: