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.

Recommended Posts

Hello!

This is my first post ever! I just wanted to share a simple gun script that uses C#. Probably the best script for beginners! There are two scripts, one for the gun, and one for the enemies to shoot at!

Hope u like it!

 

1st script:

Please login or register to see this code.

 

2nd Script (Target Script)
 

Please login or register to see this code.

 

There u go! those are all of the scripts! (Credit to brackeys for them.)

  • Like 2

Share this post


Link to post
Share on other sites

Oh i forgot:facepalm: ! When you add the script there is a section for a muzzle flash! Look up how to make one, and then drag your muzzle flash into the slot! the muzzle flash will play and you will deal damage to whatever you put your target script in! f

Share this post


Link to post
Share on other sites

Cool explaination. Thanks.

About muzzle flash, you can simply add - if (muzzleFlash != null) muzzleFlash.Play();

This way newbies can use your script without any addding...

Share this post


Link to post
Share on other sites
Posted (edited)
Please login or register to see this quote.

Thank You For This Contribution!

Edited by OneManArmy
Removed code from quote

Share this post


Link to post
Share on other sites

Why did you quote the post and add nothing?

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
Sign in to follow this  

×