the error is: Assets\damage.cs(17,2): error CS0106: The modifier ‘public’ is not valid for this item
pls help
here is the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class damage : MonoBehaviour{
public int health;
public GameObject bloodEffect;
void Update(){
if(health <= 0){
Destroy(gameObject);
}
public void TakeDamage(int damage){
instantiate(bloodEffect, transform.position, quaternion.identity);
health -= damage;
Debug.Log("damage TAKEN !");
}
}
}