Error CS1525: Unexpected symbol `}' (135273)

using UnityEngine;
using System.Collections;

public class player_control : MonoBehaviour
{
void fixedupdate()
{
float movehorizontal = Input.GetAxis(“horizontal”);
float movevertical = Input.GetAxis(“vertical”)

		Vector3 movement = new Vector3(movehorizontal, 0.0f, movevertical);

	rigidbody.addforce("movement")
}

}

rigidbody.addforce("movement"); don't forget semicolons

I did all you told me than this pops up Assets/scripts/player_control.cs(13,36): error CS0128: A local variable named `movement' is already defined in this scope

2 Answers

2

Your code is littered with errors:

  • fixedupdate should be FixedUpdate
  • no semicolon following the movevertical assignment
  • AddForce not addforce, and give it the variable movement not the string “movement”

You might want to click the Learn tab and follow some basic tutorials.

you missed ; on the end of

rigidbody.addforce(“movement”)

and the things @tanoshimi said ;)