Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Grizzly · Aug 16, 2014 at 08:18 PM · particleemitter

How to create a muzzle flash particle using legacy particles?

Basicaly what the questions says.

I wanna place particle prefab in front of my weapon barrel to simulate muzzle flash when I shoot and I have a texture for it ,but I dont know how to make that particle ,actually I dont even know where to start (when it comes to MUZZLEFLASH particle prefab)

Please help if you can.

Comment
Add comment · Show 3
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 robertbu · Aug 16, 2014 at 08:21 PM 1
Share

You need to explain more. Are you trying to use a ParticleSystem to shoot multiple particles at the barrel end, or do you want a single image that flashes on and off, or...? What does your firing code look like now?

avatar image Grizzly · Aug 16, 2014 at 08:24 PM 0
Share

No its not for shooting particles , its a Raycast shooting script for pistol so I want particle to show muzzle flash once every time when I press fire button and possibly rotate randomly.

avatar image Grizzly · Aug 16, 2014 at 08:29 PM 0
Share

But I dont need script ,I just need to know how to make particle prefab for muzzle flash based on particle emitter.

2 Replies

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

Answer by Grizzly · Aug 17, 2014 at 01:50 AM

Well after some time of testing and trying legacy shaders I managed to solve my problem on my own with legacy shaders indeed and gain new knowlage about this. Basicaly best way to do muzzle flash is by using legacy shaders imo ,easier to modify in this case ,problem is solved.

Comment
Add comment · 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
3

Answer by Nick4 · Aug 16, 2014 at 08:38 PM

Ok I'll write you through.

Create a particle system and set its startLifetime to 0.2 and adjust the start size as you like. Next, make sure looping is turned off and max particles is set to 1. Go over to emission tab and set rate to 0 and add a burst set time to 0 and particles to 1. Then go over to shape and make sure radius is at least 0.01 and now it's time for the renderer. Before we start doing stuff under the renderer tab, let's create a material first. Right click somewhere on your projects window and select Create > Material and name your material, let's say it's MuzzleMat. Select muzzlemat and attach your muzzle texture to this material. Then you need to select a particle shader. I'd recommend additive shader for a muzzle effect. Select Particles > Additive as your shader. You can also experiment with other particle shaders and see what you can come up with. Now back to our particle system. Go over to renderer tab and attach muzzlemat to material section. Deselect cast shadows and receive shadows options. BAM! There you have your muzzle effect. I haven't actually tried this but I'm sure it'll work just as you expect if you tweak the settings a bit to make it more realistic and pleasing to eye.

It's a little long but it's worth reading if you're new to particle system in Unity. Sorry if I missed anything because I'm not at home at the moment so I can't really test it myself. Good luck

Comment
Add comment · Show 12 · 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 Nick4 · Aug 16, 2014 at 09:04 PM 2
Share

OH and don't forget to set the speed to 0 as well!

avatar image Nick4 · Aug 16, 2014 at 09:48 PM 2
Share

Well it's because it's only one shot. If you want to use it on a automatic weapon then you'd need to use "rate" under the emission tab ins$$anonymous$$d of 1 burst. You can also pool all the one shot muzzle fx and light it up each shot and disable it when you're done this way it won't take up much processing power. And I'm not sure about the other particle system, I never used it. If you meant that it's off the center sometimes, make sure to set your shape to sphere and radius to at least 0.01.

For more realism on muzzle flashes, make them bigger and brighter. Here's an extra tip, $$anonymous$$ake start rotation "random between 2 constants and give them 0, 180 values in order to make the muzzle flash look different each time it's shot.

avatar image Nick4 · Aug 16, 2014 at 10:18 PM 2
Share

You have to use :

 objectWithParticleSystem.particleSystem.enableEmission = false

to disable emission.

avatar image Nick4 · Aug 16, 2014 at 10:37 PM 2
Share

It's your game object that has particle system component. But if you attach that emission disabling script to your particle system gameobject you don't need that reference. You can just write

 particleSystem.enableEmission = false;
avatar image Nick4 · Aug 16, 2014 at 10:43 PM 2
Share

In your case, you can use $$anonymous$$uzzleFlash variable to disable emission.

 $$anonymous$$uzzleFlash.enableEmission = false;
Show more comments

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

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Where to put Particle Emitter? 0 Answers

I have a particle system but I can't access it's particle emitter 1 Answer

add delay to multiple particle emitters 0 Answers

Ink-like particle effect 1 Answer

Changing emission rate only works once on mobile 0 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