Complete the code to set the particle system's start lifetime to 5 seconds.
var particleSystem = GetComponent<ParticleSystem>();
var main = particleSystem.main;
main.startLifetime = [1]f;The startLifetime property controls how long each particle lives. Setting it to 5f means particles last 5 seconds.
Complete the code to set the particle system's start speed to 3 units per second.
var particleSystem = GetComponent<ParticleSystem>();
var main = particleSystem.main;
main.startSpeed = [1]f;The startSpeed property sets how fast particles move when emitted. 3f means 3 units per second.
Fix the error in setting the particle lifetime to 0 (which disables particles). Use 1 second instead.
var particleSystem = GetComponent<ParticleSystem>();
var main = particleSystem.main;
main.startLifetime = [1]f;Setting startLifetime to 0 disables particles immediately. Using 1f sets a visible lifetime.
Fill both blanks to set the particle system's start lifetime to 2 seconds and start speed to 4 units per second.
var particleSystem = GetComponent<ParticleSystem>(); var main = particleSystem.main; main.startLifetime = [1]f; main.startSpeed = [2]f;
Setting startLifetime to 2f and startSpeed to 4f configures the particle system as requested.
Fill all three blanks to create a particle system, set start lifetime to 3 seconds, start speed to 6 units per second, and enable looping.
var particleSystem = gameObject.AddComponent<ParticleSystem>(); var main = particleSystem.main; main.startLifetime = [1]f; main.startSpeed = [2]f; main.loop = [3];
This code creates a particle system, sets lifetime to 3 seconds, speed to 6 units per second, and enables looping by setting loop to true.