Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Feedback How do I add raycast shotgun?

Discussion in 'Scripting' started by SpyderManToo, Aug 4, 2021.

  1. SpyderManToo

    SpyderManToo

    Joined:
    Dec 8, 2020
    Posts:
    387
    I have a gun script with most of the nessecary things needed(ammo, reloading, ads, etc) and I currently only have a rifle and a pistol, however, I want to add a shotgun, how can I do this?

    Ive searched online and havent found any tutorials or anything, help!
     
  2. chatrat12

    chatrat12

    Joined:
    Jan 21, 2015
    Posts:
    122
    What aspect are you struggling with, the spread?
     
  3. SpyderManToo

    SpyderManToo

    Joined:
    Dec 8, 2020
    Posts:
    387
    well, not anymore, i kinda figured out a solution using random.range, originally i just didnt know how to do it with raycasts because previously, i would always use bullets and just instantiate multiple and rotate it a bit