Error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement (Newbie)

I’m new to C# and idk how to solve this problem. I allready search it online and nothing if someone could help me i would be grateful.

This is the error:

Assets\Scripts\Player.cs(27,9): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement

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

public class Player : MonoBehaviour
{

    public float moveSpeed;
    private new Rigidbody2D rigidbody;
    private float moveX;
    private float moveY;

    void Start()
    {
        rigidbody = GetComponent<Rigidbody2D>();
    }

    void FixedUpdate()
    {
        moveX = Input.GetAxis("Horizontal");
        moveY = Input.GetAxis("Vertical");
        rigidbody.velocity = new Vector2(moveX * moveSpeed, moveY * moveSpeed);
    }

    void OnTriggerEnter2D(Collider2D col)
    {
        col.GetComponent<Animal>().Damage;
    }

}
1 Like

What is Damage? Is it function?

If so, try to use:
col.GetComponent<Animal>().Damage();