Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Dreave · Oct 03, 2011 at 08:15 PM · gunshootmuzzleflash

Gun Muzzle Flash

I know there's a lot of questions about this topic but ive tied nearly all of them and non have worked. Can anyone tell me how I could make a muzzle flash occur whenever the player presses the left mouse button? Ive heard that you make a plane and add a muzzle flash texture onto which I have done but I don't know how to code it.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image vxssmatty · Oct 03, 2011 at 10:48 PM 0
Share

This doesnt mean they dont work, it means you still have to learn how to script; step back and complete these websites and then i'm sure you'll be able todo it; www.unity3dstudent.com

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Owen-Reynolds · Oct 08, 2011 at 04:32 PM

Unity doesn't support the standard 2 billboard solution as well -- you could write it custom using a LineRender and a plane. But, a standard particle effect can make a nice one, if you know the settings (I'm skipping soem of the obvious ones, like Size):

Shrink the Ellipsoid (where they spawn from,) set OneShot and Autodestruct. Set localVelocity z to 5 or so and random x/y/z to about 3 (setting z to 3 will make the real z velocity random 2-8.) Set min/max life to around 0.1 or less (1/10th sec is 6 frames.) Go down and set StretchParticles to Stretch and LengthScale to negative (it stretches particles backwards along the way they are moving, to give a trail. Flipping to neg makes the particles stretch forwards.) Should get a quick cone.

To get it more jaggy (this is the part everyone using Emitters really need to know) make your own particle material: create a texture with a flatish bottom and jaggy top (like grass.) Put in a material, set the shader to Particles/AlphaBlended (or try the other ones near it.) Swap the material into your Emitter (replaces DefaultParticle.)

Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dreave · Oct 08, 2011 at 07:27 PM 0
Share

When you say $$anonymous$$/max life do you mean $$anonymous$$/max emission? because there isn't a setting called $$anonymous$$/max life.

avatar image Dreave · Oct 08, 2011 at 07:35 PM 0
Share

I have done all of that but how would I script it so it only shows when the left mouse button has been clicked?

avatar image Owen-Reynolds · Oct 08, 2011 at 09:04 PM 0
Share

I assume you are spawning a bullet Prefab, using Instantiate from an empty at the end of the gun. Do it again for the "flash" Particle Emitter.

avatar image Dreave · Oct 08, 2011 at 09:25 PM 0
Share

How do I change the time the particle effect lasts for? Please help

avatar image Dreave · Oct 09, 2011 at 03:58 PM 0
Share

can you help!!

Show more comments
avatar image
0

Answer by beattonick · Oct 03, 2011 at 11:46 PM

you can do the fps turorial from unity they cover how to use muzzle flashes

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dreave · Oct 06, 2011 at 04:40 PM 0
Share

The fps tutorial's muzzle flash tutorial script is mostly for damage and reloading for the rest of the guns functions which I do not want and the muzzle flash itself dosent work anyway.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

how to make gunshots 0 Answers

FPS PISTOL 1 Answer

A node in a childnode? 1 Answer

Mouse look alteration? 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges