This commit is contained in:
Scove
2026-03-26 20:27:19 +07:00
parent a94ab0e3f6
commit f42ef22a13
129 changed files with 5517 additions and 1134 deletions

View File

@@ -0,0 +1,27 @@
using UnityEngine;
public class SukunaProjectile : MonoBehaviour
{
[Header("Movement")]
public float speed = 50f;
public float lifetime = 3f;
private Vector3 moveDirection;
public void SetDirection(Vector3 direction)
{
// Nhận hướng bay từ Player (luôn là hướng phía trước)
moveDirection = direction.normalized;
}
void Start()
{
Destroy(gameObject, lifetime);
}
void Update()
{
// Di chuyển đạn theo hướng đã gán, bất kể góc xoay hiển thị của nó là gì
transform.position += moveDirection * speed * Time.deltaTime;
}
}