• 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 Nonakesh · Dec 25, 2011 at 01:05 PM · rotation axisshuriken

Shuriken Particle System GetParticles() not working

I am trying to get a effect like the old "rotation axis" in the new Shuriken particle system.

If there is a easy method for this please tell me.

My approach to solve this problem was to write a script, which changes the velocity of every particle, but it seems as if GetParticles() does not work for me.

Now the real question: How do I have to use this method?

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 Rabwin · Dec 25, 2011 at 01:31 PM 0
Share

Thats strange, I haven't seen that method anywhere and I can't get it from anything.

Not even the scripting reference shows this method anywhere?

avatar image Nonakesh · Dec 26, 2011 at 01:28 PM 0
Share

The local scripting reference does. ;)

3 Replies

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

Answer by WBDN · Dec 30, 2011 at 10:45 PM

Example script that will make all particles red:

public class ParticleBufferAccess : MonoBehaviour {

private ParticleSystem.Particle[] particles = new ParticleSystem.Particle[1000];

void LateUpdate() {

int length = particleSystem.GetParticles(particles); int i = 0;

while (i < length) {

particles[i].color = Color.red; i++;

}

particleSystem.SetParticles(particles, length); }

}

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
2

Answer by oriolmanya · Jul 12, 2016 at 12:16 PM

Thanks @WBDN, I was trying to move particles in other ways but GetParticles(particles) always returned "0", so no particles at all.

Finally the solution was to allocate space for the particles on declaration:

private ParticleSystem.Particle[] particles = new ParticleSystem.Particle[1000];

This is hidden in the bottom in Unity's documentation example, so it would be great if you improve it a little bit :)

[https://docs.unity3d.com/ScriptReference/ParticleSystem.GetParticles.html]

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
0

Answer by metervara · Mar 22, 2012 at 01:46 PM

I've noticed that there's a delay before the GetParticles() function has any particles available, that might be why there's no particles? I got it working by emitting in Start() and then getting particles in Update().

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

8 People are following this question.

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

Related Questions

Camera moves with player in doom-like 0 Answers

how to get slip angle when moving car left or right while moving in forward direction or get a realistic look without adding any wheel colliders? 0 Answers

Gameobject rotation breaks children position 1 Answer

Double Rotation : Spinning animation + Targeting player ? 0 Answers

Build rotation tool for level editor 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