Hey everyone,
I’ve run into a strange issue with my particle system…
Repro Steps (As seen in the attached video):
- Start the game
- Press “space” to apply thrust
- Note - pressing space triggers the rocket particle FX, and releasing space stops them.
- Crash and lose the game
- When the game restarts, repeat step 2.
- Observe: pressing space does not trigger the rocket FX anymore.
- Restart the game entirely and repeat steps 1 and 2.
- Observe: pressing space still doesn’t trigger the rocket FX.
At the beginning of the video, I open the Rocketship prefab and confirm all three particle systems are attached as children and linked to the appropriate Serialized Field.
I’m not sure what the issue might be, but I’m also unfamiliar with Unity 2019’s changes to prefabs…
My code is written exactly like Ben’s, except I used a different name for my FX, which I declare at the beginning of the class as:
[SerializeField] ParticleSystem rocketFX;
> private void RespondToThrustInput()
> {
> if (Input.GetKey(KeyCode.Space))
> {
> ApplyThrust();
> }
> else
> {
> audioSource.Stop();
> rocketFX.Stop();
> }
> }
>
> private void ApplyThrust()
> {
> rigidBody.AddRelativeForce(Vector3.up * mainThrust);
> if (!audioSource.isPlaying)
> {
> audioSource.PlayOneShot(rocketSFX);
> }
> rocketFX.Play();
> }