0
0
Unityframework~10 mins

Particle System component in Unity - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start the particle system.

Unity
ParticleSystem ps = GetComponent<ParticleSystem>();
ps.[1]();
Drag options to blanks, or click blank then click option'
APlay
BStop
CPause
DClear
Attempts:
3 left
💡 Hint
Common Mistakes
Using Stop() instead of Play() will stop the particles.
Pause() only pauses the emission.
Clear() removes all particles but does not start emission.
2fill in blank
medium

Complete the code to check if the particle system is currently playing.

Unity
ParticleSystem ps = GetComponent<ParticleSystem>();
if (ps.[1]) {
    Debug.Log("Particles are playing");
}
Drag options to blanks, or click blank then click option'
AisStopped
BisEmitting
CisPaused
DisPlaying
Attempts:
3 left
💡 Hint
Common Mistakes
Using isStopped will check if it is stopped, not playing.
isPaused checks if paused, not playing.
isEmitting is not a valid property.
3fill in blank
hard

Fix the error in the code to stop the particle system immediately.

Unity
ParticleSystem ps = GetComponent<ParticleSystem>();
ps.[1](ParticleSystemStopBehavior.StopEmittingAndClear);
Drag options to blanks, or click blank then click option'
APause
BClear
CStop
DPlay
Attempts:
3 left
💡 Hint
Common Mistakes
Using Pause() does not stop emission.
Play() starts particles, not stops.
Clear() removes particles but does not stop emission.
4fill in blank
hard

Fill both blanks to create a dictionary of particle systems and check if each is playing.

Unity
Dictionary<string, ParticleSystem> systems = new Dictionary<string, ParticleSystem>();
systems.Add("fire", fireParticleSystem);

foreach (var [1] in systems) {
    if ([2].isPlaying) {
        Debug.Log($"[1].Key is playing");
    }
}
Drag options to blanks, or click blank then click option'
Aentry
Bsystems
Centry.Value
Dparticle
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'systems' as loop variable causes error.
Using 'entry' but not accessing Value causes type error.
Using 'particle' is unclear and not defined.
5fill in blank
hard

Fill all three blanks to emit 10 particles with a specific start color and size.

Unity
var main = ps.main;
main.startColor = [1];
main.startSize = [2]f;
ps.[3](10);
Drag options to blanks, or click blank then click option'
AColor.red
B0.5
CEmit
DColor.blue
Attempts:
3 left
💡 Hint
Common Mistakes
Using Color.blue instead of Color.red.
Using wrong method like Play instead of Emit.
Using integer without 'f' for startSize.