Good day all,
I have candle in my game in which the player will light up by pressing a key. The flame of my candle is made up of a particle system, so I thought I’d achieve this by disabling and enabling the emission of the particle system from my script.
It (almost) works, but there’s one problem: it gets enabled with around an 8 second delay.
I’m not sure what’s happening, since I have delay time as 0.
Here’s the code:
private void Update()
{
if (Input.GetKeyDown(KeyCode.L))
{
LightUpCandle();
}
}
void LightUpCandle()
{
if (Physics.Raycast(MainCamera.transform.position, MainCamera.transform.forward, out hit, distance))
{
if (hit.collider.CompareTag("Candle"))
{
ParticleSystem.EmissionModule em = candleLight.emission;
em.enabled = true;
}
}
}
And here’s what my particle system and its emission looks like:
Can somebody tell me what’s the issue?