x


Shuriken particle.size returns start size, not actual (changed) size. How can I access the actual particle size?

Hi all. I've been playing around with the new Shuriken particle system, and while I love a lot of the new features, I am bummed that there is no world collision and am having some trouble with the API.

The idea, is that I want to roll my own world collision, by creating some colliders with the same size and position as the particles in my particle system.

Getting the position works great. However, when I try to scale my 'ParticleColliders' to the size of the particles, I only get the 'Start Size' of the particles (or so it seems).

Below is my code, where I get the particles, place all of my gameobjects (the ParticleCollider prefabs)at the location of the particle, and then attempt to get the size of the particles. However, the size is reported as being the start size, even though I drastically change the size via "Size over lifetime."

TL:DR; ParticleSystem.particle.size only returns the Start Size, not the actual size. Is there any way to get the actual size? Is this a bug?

void LateUpdate()
{
    int length = particleSystem.GetParticles(_particles);
    for (int i = 0; i < length; i++ )
    {
        var pc = _particleColliders[i];
        var p = _particles[i];
        pc.position = p.position;
        //Debug.Log(particles[i].position); 
    }
    Debug.Log(_particles[40].size);
}
more ▼

asked Feb 25 '12 at 03:04 AM

ME4T gravatar image

ME4T
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5070
x637
x161
x62

asked: Feb 25 '12 at 03:04 AM

Seen: 880 times

Last Updated: Feb 25 '12 at 03:04 AM