| 12345678910111213141516171819202122 |
- using UnityEngine;
- public class Projectile : MonoBehaviour
- {
- public Vector3 Direction;
- public float speed;
- // Start is called once before the first execution of Update after the MonoBehaviour is created
- void Start()
- {
- }
- // Update is called once per frame
- void Update()
- {
- transform.position = transform.position + (Direction.normalized * Time.deltaTime * speed);
- }
- }
|