Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Bullet : MonoBehaviour
- {
- [SerializeField]
- private float speed = 10f;
- Vector3 direction;
- void Start()
- {
- }
- public void SetDirection(Vector3 dir)
- {
- direction = dir;
- }
- private void FixedUpdate()
- {
- transform.position += direction *speed*Time.fixedDeltaTime;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement