Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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);
 
PREVIOUS NEXT
Tagged: #unity #projectile #spread
ADD COMMENT
Topic
Name
2+9 =