Answers for "how to make projectiles in unity 2d"

C#
1

unity projectile spread

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);
Posted by: Guest on July-22-2020

Code answers related to "how to make projectiles in unity 2d"

C# Answers by Framework

Browse Popular Code Answers by Language