funnymummy1119

Bullet class test

Sep 7th, 2021
1,066
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class Bullet : MonoBehaviour
  4. {
  5.     Vector3 moveDirection;
  6.  
  7.     public void Setup(Vector3 direction)
  8.     {
  9.         moveDirection = direction;
  10.     }
  11.  
  12.     private void Update()
  13.     {
  14.         transform.position = transform.position + moveDirection * Time.deltaTime;
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment