Help it doesn't make sense

Says there’s an error in line 45 and line 2. The error is cs1513. Which doesn’t make sense since i have all my curly brackets right.

using UnityEngine;
using System.Collections;
public class Player1 : MonoBehaviour
{
    bool jump = false;
    public float speed = 5f;
private float movement = 0f;
private Rigidbody2D rigidBody;
public float jumpSpeed = 8f;

// Use this for initialization
void Start()
{
    rigidBody = GetComponent<Rigidbody2D>();
   
// Update is called once per frame
void Update()
{
            movement = Input.GetAxis("Horizontal");
    if (movement > 0f)
    {
        rigidBody.velocity = new Vector2(movement * speed, rigidBody.velocity.y);
    }
    else if (movement < 0f)
    {
        rigidBody.velocity = new Vector2(movement * speed, rigidBody.velocity.y);
    }
    else
    {
        rigidBody.velocity = new Vector2(0, rigidBody.velocity.y);
    }
    movement = Input.GetAxis("Horizontal");
    if (movement > 0f)
    {
        rigidBody.velocity = new Vector2(movement * speed, rigidBody.velocity.y);
    }
    else if (movement < 0f)
    {
        rigidBody.velocity = new Vector2(movement * speed, rigidBody.velocity.y);
    }
    else
    {
        rigidBody.velocity = new Vector2(0, rigidBody.velocity.y);
    }
}

You might wanna check that again. Line 13 is already pretty close to where you should look^^
Hint: you dont close your Start() method
Hint2: Unless that’s a copy paste mistake you also dont close your class :wink:

In future posts please just include the full error message. Nobody remembers the error codes by numbers.

1 Like

Thanks