0
Answered

List

unityvisualscript 3 years ago updated 3 years ago 3

Hi,

How to create new list & assign how many element i want.

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

You can create a new List Variable and assign as many objects as you want manually or you create it.



Answered

That's the right answer indeed! Although you probably want to input 0 in the Create List node.

Just out of curiosity Elin, why are these nodes orange? Which warning are you getting in the graph inspector?

hi,

Thanks for answer.

particles = new ParticleSystem.Particle[ps.particleCount];

How can do this?


public class ParticleTest : MonoBehaviour {

    public ParticleSystem ps;
    ParticleSystem.Particle[] particles;

    void Update () {
        particles = new ParticleSystem.Particle[ps.particleCount];
        ps.GetParticles (particles);
        for(int i=0;i<particles.Length; i++){
            //do something
             ps.SetParticles (particles,particles.Length);
        }

    }
}