Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i = 0; i < bulletsPerShoot; i++)
- {
- Ray ray = ust.playerCamera.ViewportPointToRay(new Vector3(0.5F, 0.5F, 0));
- float x = Random.Range(-spread / 100 , spread / 100);
- float y = Random.Range(-spread / 200, spread / 200);
- if (Physics.Raycast(ray, out hit))
- {
- targetPoint = hit.point + new Vector3(x, y, 0);
- }
- else
- {
- targetPoint = ray.GetPoint(range) + new Vector3(x, y, 0);
- }
- InstantiateBullet(bulletDamage, bulletHeadDamage);
- bulletsLeft--;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement