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 IgorUnity3D · Jan 22, 2017 at 12:23 AM · particlesystemparticlestars

2D Game - How to Create an starfield with particle systems

Hi,

I'm trying to create a starry sky for a 2D game using Unity's particle system. Is it possible to create particle emission only once? And after that only work with the alpha of emitted particles? (Blink effect)

I have something like this:

alt text

But it gets emitted all the time, is it possible to do what I'm thinking?

I would like something like this:

alt text

I appreciate any tips, even if that is not the best way to do it.

Thank you!

particlesystem.png (20.5 kB)
bg-1-1.png (21.5 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ifurkend · Jan 22, 2017 at 05:36 AM

You set random between 2 very high constants of start lifetime about the expected duration of your scene. For the blinking effect, if you are using Unity 5.5, the looping function for curve graph is really helpful to repeat the curve. Refer to my attached image, in the Size over Lifetime curve graph, I set 5 linear points with the middle one dipped to zero. Then at the right end of the curve there is a cog and you can click it to set "loop". Finally press "Ctrl+A" in the graph to select all visible points, there is 4 "scaling" blue lines, drag the right vertical blue line leftward and you can see the pattern of the curve is repeated. Because you have already set "random between 2 lifetime constants", you don't need to worry about the particles blinking in the same moment. If you are using older Unity, then you will need to repeat those points in the curve graph manually.

Lastly about performance with texture/material: Normally you would use a star/flare texture for better result, but if you are concerned with performance, you may downgrade the material to just unlit-color shader which is opaque instead of alpha. Alpha overdraw is something you want to reduce as much as possible especially for mobile game.


star-size-over-life.png (53.8 kB)
Comment
Add comment · Show 4 · 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 IgorUnity3D · Jan 22, 2017 at 03:38 PM 0
Share

@ifurkend Thanks for response!

I got something like this before your answer. I'll do as you said to see the result. One doubt ... is it possible to generate the "stars" only once? Rather than being generated at random points? I need them to just blink

avatar image ifurkend IgorUnity3D · Jan 22, 2017 at 04:19 PM 0
Share

That depends on how much randomness you want to avoid. If you want the stars to appear on fixed positions, you create a mesh where vertices are the point of spawn and import it to Unity. In Unity, position your imported mesh, attach your star particle object under it and change emitter "shape" to "mesh renderer", load that mesh object. However, because the default particle UI does not provide a way to avoid overlapping even if the max particles count equals the vertices of your mesh, you will need to loop through the ParticleSystem.GetParticles via script to assign each particle to $$anonymous$$esh.vertices which I haven't done before.

avatar image IgorUnity3D ifurkend · Jan 23, 2017 at 12:32 PM 0
Share

I wish the stars were fixed in one place, just by varying their light (blinking). How would it be: "create a mesh where vertices are the point of spawn and import it to Unity"? Was it an image with the stars?

Thanks

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Did the behavior of gravity of particleSystem ever changed? 0 Answers

[Tank Game Tutorial] Particles Only Appear While Turning 2 Answers

Teleporting old particle system 0 Answers

Start/Stop a Particle System 2 Answers

ParticleSystem at Photon Not working! 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