Finished tutorial

This commit is contained in:
2026-01-09 10:41:51 +00:00
parent 2a9d124288
commit c8d27ef133
154 changed files with 69096 additions and 4653 deletions

View File

@@ -2,12 +2,14 @@ using UnityEngine;
public class ObjectHit : MonoBehaviour
{
[SerializeField] int damageAmount = 10;
private void OnCollisionEnter(Collision other)
{
if (other.gameObject.tag == "Player")
if (other.gameObject.tag == "Player" && gameObject.tag != "Hit")
{
GetComponent<MeshRenderer>().material.color = Color.black;
gameObject.tag = "Hit";
other.gameObject.GetComponent<PlayerStats>().TakeDamage(damageAmount);
}
}
}