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?
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; } } }
Think about when the emission rate changes in the Update method.
The emission rate starts at 10. After 2 seconds, the Update method sets it to 50. At 3 seconds, it remains 50.
In Unity, to create a realistic smoke effect, which component is most commonly used?
Think about what creates many small moving dots or shapes to simulate smoke.
The Particle System component emits many small particles that can simulate smoke movement and appearance.
Look at this Unity C# script meant to trigger a sparkle effect. Why does it not show any particles when run?
using UnityEngine; public class SparkleEffect : MonoBehaviour { public ParticleSystem sparkleParticles; void Start() { sparkleParticles.Stop(); } void Update() { if (Input.GetKeyDown(KeyCode.Space)) { sparkleParticles.Play(); } } }
Check if the particle system variable is properly set before use.
If sparkleParticles is not assigned in the Unity inspector, it remains null. Calling Play() on null does nothing and no particles appear.
Choose the correct code snippet to set the start color of a smoke Particle System to gray.
ParticleSystem smokeParticles; // Set start color to gray
Remember the correct property name for accessing the main module.
The ParticleSystem's main module is accessed via the 'main' property (lowercase). Then startColor can be set.
A sparkle Particle System is set to emit 5 particles per second continuously. How many particles will have been emitted after 4 seconds?
ParticleSystem sparkleParticles;
void Start() {
var emission = sparkleParticles.emission;
emission.rateOverTime = 5f;
sparkleParticles.Play();
}Multiply emission rate by time to find total particles emitted.
At 5 particles per second, after 4 seconds, 5 * 4 = 20 particles are emitted.