Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

UnityGamesRoland

Advanced Shoot - Ammo, Ammo Pickup, Spread, Shoot Mode etc...

Recommended Posts

Im working on this pack a few days now, and im proud of my work. It is completely made from scratch by me. It contains a complete modular, advanced raycast based shooting script.
You can create any type of gun within seconds. You can use it in your project, no credits required. Download the pack Please login or register to see this link. !
 
The pack has two scripts. Both script has a user friendly interface:

Please login or register to see this spoiler.


 
Features:

  • Ammo (Counts in bullets)
  • Ammo Pickup
  • Shoot Mode (Auto and Semi) (You can also switch between the two)
  • Particles and Sounds
  • Spread
  • GUI Display (Weapon name, current ammo / inventory ammo, shoot mode)

Setup:

  • Find your gun and assign the RaycastShoot script into it. (You can easily do that via the custom menu: Add Component > AdvancedShoot > RaycastShoot)
  • Create a new tag ("ammoPickup") and add this tag to the object you want to use as ammo pickup.
  • Add the ammoPickup script to the player, and assign your current weapon to the affectedWeapon slot. (This will be the gun that you get ammo for.)
  • Play with the values of the scripts, and enjoy your advanced shooting mechanics.

 

     There are two examples for hit effects: "Ground" and "Enemy" (Create new tags for these, and add them to your objects.)
     You can extend these in the RaycastShoot script at the 128. line, but dont forget to also do that at the 165. line.

 

Donate:

If you found this pack useful, you can donate me by clicking Please login or register to see this link. !

Some of you know me, and know that im not doing this for the money, but these days money is necessary.

Edited by UnityGamesRoland
  • Like 6

Share this post


Link to post
Share on other sites

Sounds cool, might try it out, not gonna use it though, still impressive work. Few pointers for next time or not:

- Use classes for different type of settings and certain setting based functions inside the classes aswell.
- Use raycasting certain layermasks or atleast allow players to set their certain layermask detection when raycasting, so the raycast wont draw a hit for every object in your scene, but certain ones for example only ground or only enemy layers.
- Try to decrease the amount of your temporary variables, for example instantiating bullet.

Other than that from quickly looking at the script, it is good, would use it but unfortunately i have already made my own. Plus side for this script is the dynamics, you can customize it very highly.

  • Like 1

Share this post


Link to post
Share on other sites

hey, your link is broken i would love to use your script in my game it can save my time can reupload it or email me plz at alvinrisk1.yt@gmail.com

thanks

 

Share this post


Link to post
Share on other sites
Please login or register to see this quote.

I agree, nothing works. I wish it did because this seems like a really good asset to have.

Share this post


Link to post
Share on other sites
Please login or register to see this quote.

Hey, if you still have the asset from when the link was working could you send me a link with the download and files in it thanks!

Share this post


Link to post
Share on other sites
Please login or register to see this quote.

Hey, if you still have the asset from when the link was working could you send me a link with the download and files in it thanks!

 

And to make damage to players I'm assuming you would go to the function where the raycast shoot is called and you would make a maxHealth float variable and assign it to 100 or whatever you want and make a currentHealth float variable that is set to 100 or whatever you want, and you also want to make a damage float variable for each weapon so you would be able to apply the amount of the weapon does to the player.

 

Down in the raycast shoot function I would say you put:

 

currentHealth = maxHealth - damage;

 

Im not precisely sure I haven't even seen the code, but if you have the files please share a link with me I need this asset, reply back please.

Share this post


Link to post
Share on other sites
Please login or register to see this quote.

Hey, if you still have the asset from when the link was working could you send me a link with the download and files in it thanks!

Share this post


Link to post
Share on other sites

Maybe because this post has been written almost 3 years ago? Deprecated. Not a big deal to create another one.

PM its author ++

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×