Error code: CS1525

“Unexpected Symbols”

Script:

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

public float speed = 2f;
CharacterController player;

float moveFB;
float moveLR;

public class FPScontroller1 : MonoBehaviour {

	// Use this for initialization
	void Start () {

        player = GetComponent<CharacterController> ();
	}
	
	// Update is called once per frame
	void Update () {

        moveFB = Input.GetAxis("Vertical") * speed;
        moveLF = input.GetAxis("Horizontal") * speed;
        Vector3 movement = new Vector3 (moveLR, moveFB, 0);
        movement = transform.rotation * movement;

        player.Move (movement * Time.deltaTime);
	}
}

Please help me!! thanks.

You never declare the variable “moveLF”.

I suspect you meant to type “moveLR”.

You have the following defined outside your class

public float speed = 2f;
CharacterController player;

float moveFB;
float moveLR;

it needs to be inside like so

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

public class FPScontroller1 : MonoBehaviour {

    public float speed = 2f;
    CharacterController player;

    float moveFB;
    float moveLR;

	// Use this for initialization
	void Start () {

        player = GetComponent<CharacterController> ();
	}
	
	// Update is called once per frame
	void Update () {

        moveFB = Input.GetAxis("Vertical") * speed;
        moveLR = input.GetAxis("Horizontal") * speed;
        Vector3 movement = new Vector3 (moveLR, moveFB, 0);
        movement = transform.rotation * movement;

        player.Move (movement * Time.deltaTime);
	}
}