0
0
Unityframework~20 mins

Visual effect examples (fire, smoke, sparkle) in Unity - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Visual Effects 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 Unity C# script controlling a fire particle system?

Consider this Unity C# script snippet that controls a fire particle system's emission rate over time. What will be the emission rate after 3 seconds?

Unity
using UnityEngine;

public class FireControl : MonoBehaviour {
    public ParticleSystem fireParticles;
    private ParticleSystem.EmissionModule emission;

    void Start() {
        emission = fireParticles.emission;
        emission.rateOverTime = 10f;
    }

    void Update() {
        if (Time.time > 2f) {
            emission.rateOverTime = 50f;
        }
    }
}
A10
B0
C50
DThrows NullReferenceException
Attempts:
2 left
💡 Hint

Think about when the emission rate changes in the Update method.

🧠 Conceptual
intermediate
1:00remaining
Which Unity component is essential for creating smoke effects?

In Unity, to create a realistic smoke effect, which component is most commonly used?

AParticle System component
BLight component
CAudio Source component
DAnimator component
Attempts:
2 left
💡 Hint

Think about what creates many small moving dots or shapes to simulate smoke.

🔧 Debug
advanced
2:30remaining
Why does this sparkle effect script not show any particles?

Look at this Unity C# script meant to trigger a sparkle effect. Why does it not show any particles when run?

Unity
using UnityEngine;

public class SparkleEffect : MonoBehaviour {
    public ParticleSystem sparkleParticles;

    void Start() {
        sparkleParticles.Stop();
    }

    void Update() {
        if (Input.GetKeyDown(KeyCode.Space)) {
            sparkleParticles.Play();
        }
    }
}
AsparkleParticles is never assigned in the inspector, so it's null causing no particles
BsparkleParticles.Stop() in Start prevents particles from ever playing
CInput.GetKeyDown does not detect space key
DParticleSystem.Play() is deprecated and does nothing
Attempts:
2 left
💡 Hint

Check if the particle system variable is properly set before use.

📝 Syntax
advanced
1:30remaining
Which option correctly sets the color of a smoke particle system to gray in Unity C#?

Choose the correct code snippet to set the start color of a smoke Particle System to gray.

Unity
ParticleSystem smokeParticles;
// Set start color to gray
A
var main = smokeParticles.Main;
main.startColor = Color.gray;
BsmokeParticles.startColor = Color.gray;
CsmokeParticles.MainModule.startColor = Color.gray;
D
var main = smokeParticles.main;
main.startColor = Color.gray;
Attempts:
2 left
💡 Hint

Remember the correct property name for accessing the main module.

🚀 Application
expert
2:00remaining
How many particles will be emitted after 4 seconds with this sparkle emission setup?

A sparkle Particle System is set to emit 5 particles per second continuously. How many particles will have been emitted after 4 seconds?

Unity
ParticleSystem sparkleParticles;

void Start() {
    var emission = sparkleParticles.emission;
    emission.rateOverTime = 5f;
    sparkleParticles.Play();
}
ACannot determine without max particles setting
B20 particles
C5 particles
D0 particles
Attempts:
2 left
💡 Hint

Multiply emission rate by time to find total particles emitted.