NPC: Version 1.0.0

This commit is contained in:
manhduyhoang90
2026-06-03 13:42:09 +07:00
parent ff36df26d4
commit 846ddb25ce
9 changed files with 522 additions and 48 deletions

View File

@@ -0,0 +1,30 @@
using UnityEngine;
public class LaserProjectile : MonoBehaviour
{
public float speed = 5f;
public float lifeTime = 5f;
private void Start()
{
Destroy(gameObject, lifeTime);
}
private void Update()
{
transform.position +=
transform.forward *
speed *
Time.deltaTime;
}
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
Debug.Log("Player Hit");
Destroy(gameObject);
}
}
}