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 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.

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

Track Quaternion local Y axis to position 1 Answer

Why is rotation offset 1 Answer

Using Camera screen point to ray for look rotation problem... 1 Answer

Vector3 - Rotate a cube by its spatial (longer) diagonal 1 Answer

ARCore - Lean touch- Use Lean Custom Rotation script to limit the rotation only in Y axis 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