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.

  • 0
BSG-Development

Full Auto Muzzle Flash

Question

Hi and I have a problem sice I am c# coder I am coding everyting in c# now.

I have my M4A1 gun inside of my game and I want to muzzle flash appear after every shot for example I am holding fire 1 button and I want to see muzzle flash constantly turning on and off (after every fired bullet)

 

Here is my code:

Please login or register to see this spoiler.

Share this post


Link to post
Share on other sites

32 answers to this question

Recommended Posts


  • 0
Please login or register to see this quote.

 

you genius you have no fire rate set in your script so the fire rate will be as high as your fps are

Share this post


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

 

well, this is my statement:

Please login or register to see this code.

 

and this in void Update:

Please login or register to see this code.

 

you need these variables:

Please login or register to see this code.

 

and in your fire void

 

Please login or register to see this code.
  • Like 1

Share this post


Link to post
Share on other sites
  • 0

Tnx themars2011 it works :d

But now when I shoot (I set fire rate to 1 (inspector) my M4A1 is kinda slow how can I make it faster ,what is the M4A1 defualt fire rate (real life) ?

Share this post


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

 

set the float fireRate to a lower value (e.g. 0.8) in the inspector. for my mp7 I use 0.5 which is very fast

Share this post


Link to post
Share on other sites
  • 0

I can only show you how I did mine:

Please login or register to see this code.

Please login or register to see this link.

 

look at 1:10

  • Like 1

Share this post


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

 

well... no, you need these variables:

Please login or register to see this code.

and this enum:

Please login or register to see this code.

and you need to credit me ;)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...