I noticed that thrust particle does not cease when you are in the state of "Dying"

I noticed that thrust particle does not cease when you are in the state of “Dying”. To stop the thrust when dying, I added the following line of code in the StartDeathSequence() -function/method:

mainEngineParticles.Stop();

However I do prefer the thrust to be on during the “dying state”, because I think it looks better when the thrust trail is on when dying.

I did the same thing, but now it gives me an error: SerializedObject target has been destroyed.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

It doesn’t break anything, but it’s still troubling

I’ve made a separate method for lose sequence and the error disappeared. Why?

Well, I figured it out myself. If you set a value to a serialized variable outside of start, when a scene is reloaded the variable has no value, so it gives you this error.

Thanks for this. I was confused, as I had audioSource.Stop and engineEffects.Stop right next to each other.
My audio was stopping fine but my engine wasn’t, couldn’t figure out how one was fine when the other wasn’t.

After taking your suggestion i found I had already put an audioSource.Stop in my DeathSequence(). And my other audioSource.Stop was not only completely redundant, but most likely not working anyway.

So, this little bug (and your help) did help me tighten up my code a little bit at least.

1 Like

Privacy & Terms