Particle effect not working, tried all solutions i could find

Hi guys, little late to the series, but i’m absolutely loving the lessons provided.

I’ve recently come upon a problem with the thruster particle system. This has been discussed a few times, and i’ve tried all solutions i could find, with the main ones being:

  • First drag your particle prefabs into the hierachy, link the hierachy children to the script and then create the prefab
  • Edit the code with if(!mainEngineParticles.isPlaying){mainEngineParticles.stop());

but none seem to work and it’s driving me absolutely crazy. My problem in steps is

  • When i drag a new prefab into the scene it works once
  • When i die and a level loads all particles work except for the thrust.
  • When i open the rocket in the inspector DURING GAMEPLAY is somehow does work, but only if it’s kept open.
  • If i stop testing and directly start testing again the thrust doesnt work and the inspector fix doesnt work unless ive died once and returned to level 1.

The weirdest thing is that there’s no problem at all if i use a different particle than the thrust particle. If i assign for the death effect for example everything works just fine throught every stage of the game.

Can anyone help me with this?

Hi,

Welcome to our community! :slight_smile:

What you describe sounds … strange. Which version of Unity do you use? If you suspect that the strange behaviour could be caused by a bug, you could try to update Unity. Make sure you use a stable version because alpha and beta versions are usually full of bugs.

Are there any error messages in your console during runtime, for example, a NullReferenceException?

Hi,

Thanks, i hope to learn a lot from it :wink:

I use version 2019-3-9f1, but i’ve tried it on all available version to see if it had any effect on the result, since that’s changeable from the hub.

I’ve had a look at my console during runtime, and there are 3 different errors, but im not certain they’re NullReferenceExceptions. They all hold the same message, except for the type of particle effect. They read:

Assets\Scenes\Rocket.cs(19,37): warning CS0649: Field ‘Rocket.successParticles’ is never assigned to, and will always have its default value null.

I tried searching for the error, but i got no result :thinking:

If there is a yellow icon in front of the messages, those messages would be harmless warnings, probably caused by a bug in Unity. Double click on each message in your Console, and add = default; behind the respective variable declaration.

I’m wondering if another message pops up in the console when this happens.

There is/was a strange bug in Unity which prevents the rocket from flying when it is selected in the Inspector. Maybe that’s the problem here?

Hey, I have the same problem as him but I don’t have any error massages at all. I tried couple of times to delete and re import the package but nothing is working… I did exactly what Ben did. I sitting one hour on this and can’t found a solution, should I skip it for now?

Hi Tikokito,

What do you mean by “nothing is working”? Did you drag the particle system assigned to a child of a rocket to the rocket? If not, do that. If you assigned the prefab from the Assets folder, you will not see anything because a prefab is never in a scene.

I tested a few different ways, but no other error messages seem to pop up anywhere. And on the bug note, for me it somehow only uses the particle effect once i have it in the inspector. I’ve also tried to mix and match different particle effects, and for some reason it really only comes up when i use the one provided with the lectures, so i guess the problem is kind of fixed? Im still very confused as to what’s causing the bug, but a fix is a fix


This is the situation right now… I tried to drag them into the scene but it does not let me. What to do then?

Here is a video… It’s only works now when I’m on the rocketship inspector and only when I’m on level 1

The rocket in level 1 works as expected, doesn’t it?

If so, do the following: Click the right mouse button on the rocket in the Hierarchy in level 1, then on “Unpack prefab completely”. Remove the Rocket prefab from your Assets folder. Then drag the rocket from your Hierarchy into your Assets folder.

Go to level 2 and replace the rocket in the Hierarchy with the rocket from your Assets folder.

Test your game again.

If this worked and you need to change something on the rocket, double click on the rocket prefab in your assets folder to get into the prefab mode. Edit the rocket there. All changes will get applied to the rocket game objects which are based on this prefab.

[SOLVED] Heya, just worked out a fix that perhaps was overlooked- my thruster working here and there- I realised the thruster particles were layering when you hold down the spacebar, just like the sound was. not a problem for the die or win particles becuse they are coded to happen once, unlike this. fixed it with this code

 private void ApplyThrust()
    {
        rigidBody.AddRelativeForce(Vector3.up * mainThrust);

        if (!audioSource.isPlaying) // so it doesn't layer
        {
            audioSource.PlayOneShot(mainEngine);
        }

        if (!mainEngineParticles.isPlaying) // SO THE ENGINE PARTICLES DON"T LAYER EITHER
        {
            mainEngineParticles.Play();

        }
}
3 Likes

Thanks Luke. That solved my similar issue also :pray:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms