Added randomization to bullet speed

This commit is contained in:
Gregory Campbell
2020-07-11 10:51:01 -04:00
parent 31b10c556a
commit b0b4c2b378
+2 -1
View File
@@ -4,13 +4,14 @@ using UnityEngine;
public class BulletScript : MonoBehaviour public class BulletScript : MonoBehaviour
{ {
public float speed;
private float speed;
private Rigidbody2D rb; private Rigidbody2D rb;
void Start() void Start()
{ {
rb = GetComponent<Rigidbody2D>(); rb = GetComponent<Rigidbody2D>();
speed = Random.Range(3.0f, 8.0f);
} }
void FixedUpdate() void FixedUpdate()