Projectile.cs 397 B

12345678910111213141516171819202122
  1. using UnityEngine;
  2. public class Projectile : MonoBehaviour
  3. {
  4. public Vector3 Direction;
  5. public float speed;
  6. // Start is called once before the first execution of Update after the MonoBehaviour is created
  7. void Start()
  8. {
  9. }
  10. // Update is called once per frame
  11. void Update()
  12. {
  13. transform.position = transform.position + (Direction.normalized * Time.deltaTime * speed);
  14. }
  15. }