From b0b4c2b378c77bbc221d34fef5b9b2e5c890b1fb Mon Sep 17 00:00:00 2001 From: Gregory Campbell Date: Sat, 11 Jul 2020 10:51:01 -0400 Subject: [PATCH] Added randomization to bullet speed --- Assets/Scripts/BulletScript.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/BulletScript.cs b/Assets/Scripts/BulletScript.cs index fc0f076..f469a94 100644 --- a/Assets/Scripts/BulletScript.cs +++ b/Assets/Scripts/BulletScript.cs @@ -4,13 +4,14 @@ using UnityEngine; public class BulletScript : MonoBehaviour { - public float speed; - + + private float speed; private Rigidbody2D rb; void Start() { rb = GetComponent(); + speed = Random.Range(3.0f, 8.0f); } void FixedUpdate()