Check out example codes for "unity projectile spread". It will help you in understanding the concepts better.

Code Example 1

Quaternion spread = Quaternion.Euler(transform.rotation.eulerAngles + new Vector3((Random.Range(-amount, amount), Random.Range(-amount, amount), 0f));

GameObject bullet = Instantiate(bulletPrefab, transform.position, spread) 
                                     
bullet.GetComponent<Rigidbody>().AddRelativeForce(Vector3.forward * Force);

Learn ReactJs, React Native from akashmittal.com