0
0
Unityframework~20 mins

Particle lifetime and speed in Unity - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Particle Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this particle lifetime calculation?
Consider a particle system where each particle's lifetime is set to 5 seconds and speed is 10 units per second. What is the total distance traveled by a particle before it disappears?
Unity
float lifetime = 5f;
float speed = 10f;
float distance = lifetime * speed;
Debug.Log($"Distance: {distance}");
ADistance: 10
BDistance: 50
CDistance: 5
DDistance: 15
Attempts:
2 left
💡 Hint
Distance is speed multiplied by time.
🧠 Conceptual
intermediate
1:30remaining
Which property controls how long a particle stays alive in Unity's Particle System?
In Unity's Particle System, which property directly sets the duration a particle exists before disappearing?
AStart Lifetime
BStart Speed
CEmission Rate
DGravity Modifier
Attempts:
2 left
💡 Hint
Think about how long a particle lasts.
🔧 Debug
advanced
2:30remaining
Why does this particle system not move particles as expected?
Given this code snippet, why do particles not move even though speed is set? ```csharp var ps = GetComponent(); var main = ps.main; main.startSpeed = 5f; ps.Play(); ``` Choose the correct reason.
AThe particle system is not playing because Play() was called before setting startSpeed.
BThe startSpeed property is read-only and cannot be set in code.
CParticles need a Rigidbody component to move with speed.
DThe particle system's simulation space is set to Local, so particles move with the system and appear stationary.
Attempts:
2 left
💡 Hint
Check the simulation space setting in the Particle System.
📝 Syntax
advanced
2:00remaining
Which code correctly sets particle lifetime and speed in Unity?
Select the code snippet that correctly sets the particle system's start lifetime to 3 seconds and start speed to 8 units per second.
A
var main = ps.main;
main.startLifetime = new ParticleSystem.MinMaxCurve(3f);
main.startSpeed = new ParticleSystem.MinMaxCurve(8f);
B
ps.startLifetime = 3f;
ps.startSpeed = 8f;
C
var main = ps.main;
main.startLifetime = 3f;
main.startSpeed = 8f;
D
var main = ps.main;
main.startLifetime = 3;
main.startSpeed = 8;
Attempts:
2 left
💡 Hint
startLifetime and startSpeed expect MinMaxCurve types.
🚀 Application
expert
3:00remaining
How to make particles slow down over their lifetime?
You want particles to start fast and gradually slow down until they stop before disappearing. Which approach achieves this in Unity's Particle System?
AIncrease startLifetime and decrease startSpeed in the main module.
BSet startSpeed to zero and increase it over time in Update().
CUse the 'Limit Velocity over Lifetime' module with a decreasing speed multiplier.
DAdd a Rigidbody and apply drag to slow particles.
Attempts:
2 left
💡 Hint
Look for modules that control speed changes over time.