Created
May 20, 2022 07:54
-
-
Save Plnda/3e87e26687f0e663628b61c1e9d4088e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var projectileCount = 3; | |
var initialOffset = -30; | |
for(int i = 0; i < projectileCount; i++) { | |
var projectile = Instantiate(projectile, cam.transform.position, cam.transform.rotation * Quaternion.Euler(0,initialOffset,0)); | |
initalOffset += 30; | |
projectile.GetComponent<Rigidbody>().AddForce(projectile.transform.forward * 15, ForceMode.Impulse); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment