error CS1513: } expected

I’m very new to this, so I don’t know how and where I did wrong… please help me. :slight_smile:

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

public class Enemy : MonoBehaviour{
    public Transform player;
    public float moveSpeed = 5f;
    private Rigidbody2D rb;
    private Vector2 movement;
    // Start is called before the first frame update
    void Start(){
        rb = this.GetComponent<Rigidbody2D>();
    }

    // Update is called once per frame
    void Update(){
        Vector3 direction = player.position - transform.position;
        float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
        rb.rotation = angle;
        direction.Normalize();
        movement = direction;
    }
    private void FixedUpdate() {
        moveCharacter(movement);
    }
    void moveCharacter(Vector2 direction){
        rb.MovePosition((Vector2)transform.position + (direction * moveSpeed * Time.deltaTime));
    {
   
    void OnCollisionEnter(Collision col)
{
    // check If you collide with the player
    // I dont remember if you check it with col.tag - needs checking
    if(col.tag == "Player")
    {
        col.GetComponent<ScriptWhichHasHealth>().Damaged(damage);
        }
    }
   
}

Line 28, replace { with }

this.

@kucid learn the check those lines that VS Code and other IDEs and editors show for brackets - you see a vertical line from the start going to the end of that bracket pair. That helps you to see if you got something basic like that wrong.

@Olmi ok, will do, thank you! :slight_smile: