Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
4
Question by Woj_Gabel_FertileSky · Aug 23, 2012 at 02:07 PM · materialparticlesystemrenderer

How to Access particleSystemRenderer

Hi! I want to change material properties of my particle. How can i access the material property? In the docs there is :

http://docs.unity3d.com/Documentation/ScriptReference/ParticleSystemRenderer.html

tried:

particleSystem.renderer.material.Color

but that doesnt work, it changes the gameObject's renderer material, not the particles. And no, I cant change it with the color varialbe of the particleSystem, due to many other varialbes in the material that I want to access.

But i cannot access that. It says inherit from renderer, but cant go that way, unity gives me an error.

Is there a way? If this not accessible then why add it to the docs?

Comment
Add comment · Show 2
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 Woj_Gabel_FertileSky · Aug 26, 2012 at 09:34 AM 0
Share

Ok, so a workaround is to set color variable name as _TintColor in the shader. That way the start color property in the particle system will change the color of the shader. I would be happy to access other properties of the material though.

avatar image ScroodgeM · Aug 26, 2012 at 06:51 PM 0
Share

you can open used in your case shader source and check for all properties you can change.

3 Replies

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

Answer by davvilla · May 08, 2013 at 03:38 AM

This is an old question but I was looking for the same answer and I finally figured it out. This worked for me, I hope it still helps or helps someone else!

 ParticleSystemRenderer pr = (ParticleSystemRenderer)someGameObject.particleSystem.renderer;
 pr.renderMode = ParticleSystemRenderMode.VerticalBillboard;
 pr.material.Color = Color.Blue;
Comment
Add comment · Show 2 · 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 TruffelsAndOranges · Nov 24, 2015 at 05:01 PM 0
Share

This doesn't work anymore with Unity 5.2. The renderer is marked as obsolete and calls an error to the compiler (not a warning as before).

Anyone have any idea how to get the ParticleSystemRenderer with the new system?

avatar image rocket5tim · Nov 27, 2015 at 05:48 AM 0
Share

This totally works: http://docs.unity3d.com/ScriptReference/Renderer-material.html

Just replace Renderer with ParticleSystemRenderer

avatar image
13

Answer by amzin7000 · Nov 26, 2016 at 06:23 AM

The other answer has long been depreciated.

the ParticleSystemRenderer is simply an invisible component attached to the gameobject.

Just use gameObject.GetComponent<ParticleSystemRenderer>() (where gameObject has a particleSystem component).

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 maxivi · Sep 09, 2018 at 08:11 AM 4
Share

The other other answer has now deprecated also. Just use GetComponent<ParticleSystem>().GetComponent<Renderer>()

avatar image
0

Answer by Rachan · Apr 03, 2021 at 03:13 AM

ParticelSystem have no renderer parameter anymore.

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

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

13 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

Related Questions

Changing two different objects renderer colour 1 Answer

Blast Particle Gets Cut Off 0 Answers

SetPropertyBlock doesn't work for particle systems? 0 Answers

Can I access the Material of an animated object via code? 1 Answer

Issue with Mesh Renderer and Skinned Mesh Renderer 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