- Home /
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);
}
Arrgh I just discovered the same problem...and it's been almost 2 years since your post. How has this not been fixed!
Vote to get it fixed...
Answer by salat · May 31, 2013 at 09:48 AM
I am stuck with same situation, looks like bug. In your case you probably could calculate particle size from current lifetime knowing the initial size. ( I do that using "Size by Speed" )
Your answer
Follow this Question
Related Questions
Identify particle on OnParticleCollision 0 Answers
Adjust particles to simluate real world 0 Answers
Shuriken OnParticledCollision 2 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Resetting non-looping particle system 5 Answers