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
3
Question by NutellaDaddy · Dec 27, 2013 at 11:26 PM · particlescolorground

How to change the color of Particle System?

I have a particle system for this ball rolling on the ground. I want the particles to change color every time the surface that it is rolling on changes color to correspond with the ground color.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
-4
Best Answer

Answer by emc233 · Dec 28, 2013 at 05:06 AM

You can look at the script reference for a Particle System and you can change the color using the Color reference page.

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
37

Answer by ScreamingScythe · Mar 27, 2017 at 04:23 PM

After the recent update this is done via:

 ParticleSystem.MainModule settings = GetComponent<ParticleSystem>().main;

 settings.startColor = new ParticleSystem.MinMaxGradient( yourColor );
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 ABerlemont · May 22, 2017 at 06:21 PM 0
Share

As for Unity 6.5.1 this is the best answer

avatar image TheGreenOne · Jul 04, 2017 at 02:48 PM 2
Share

You can also assign a Color to ParticleSystem.$$anonymous$$ain$$anonymous$$odule.startColor like:

settings.startColor = yourColor;

as explained in https://docs.unity3d.com/ScriptReference/ParticleSystem.$$anonymous$$ain$$anonymous$$odule-startColor.html

avatar image HMiri · Sep 06, 2017 at 10:00 AM 1
Share

I am confused by the new particle system API. It seems like the color and size properties can no longer be manipulated for individual points/particles. How would I re-write myArray[i].color = new Color(x, 0f, 0f) or myArray[i].startSize = 0.1f or Color c = myArray[i].color; c.g = p.y; myArray[i].color = c for example?

avatar image akuno · Oct 26, 2020 at 12:22 AM 0
Share

This seems like a cumbersome way to just change a color. Couldn't they have just added some method or a simple way to do it, like how was done before?

avatar image
33

Answer by arckex · Jun 05, 2014 at 11:42 PM

emc233 is wrong and not even trying to help. it's through the startColor attribute of the Particle System

 this.GetComponent<ParticleSystem>().startColor = new Color(1, 0, 1, .5f);
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 lodendsg · Jul 21, 2016 at 11:33 PM 1
Share

It actually used to be ParticleSystem.color but that was depreciated sometime ago as it is a procedural calculation so you should use ParticleSystem.startColor to get/set the start color or use ParticleSystem.GetCurrentColor(...) to get the current color

This is useful info if your wondering how you should go about updating depreciated code

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

27 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 avatar image avatar image avatar image avatar image

Related Questions

Changing color of particles 1 Answer

How do you change the colour of individual particles having assigned them a material? 1 Answer

Change color of Particles 2 Answers

Particle systems in Unity are different during build 0 Answers

How to make the ground evaporate? 1 Answer


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