Particle Problems

So something prominant has come up with my bullets. for some reason only one side of my gun will shoot sometimes when im flying through my world. if you look at the video at 0:09 seconds you can see that only the right side gun is shooting for a short time.

Hi Jayy,

Which version of Unity do you use?

Is “Play On Awake” enabled in the Particle System? If so, disable it.

Try to set the Culling Mode to “Always Simulate”. If that does not fix the issue, set it back to the default value.

Add a Debug.Log to the method that enables the particle system to see if it unexpectedly gets called for some reason.

Yeah. Those didnt do anything except turn off my particles so i couldnt shoot. for DEBUG.LOG do i just print in the console when im shooting and when im not shooting or is there a specific way

There is no specific way. Do it as it makes sense to you. The goal is to figure out if the particle system gets enabled by a method call. If the method does not get called but the particles appear, you know that the issue is not the method, and you can look somewhere else.

This was the best i could do if it helps.

In the console the first thing says guns are off and the second one says guns are shooting.

the console gives me the same thing when i turn off play on wake and stimulate only differenrce is no actual bullets come out

That’s fine. I wouldn’t place the Debug.Logs inside the foreach loops as it logs more messages than necessary into your console, but that’s a matter of taste.

Did the expected messages appear when you were keeping the “Fire” button pressed and not pressed respectively?

Since the problem is that only the right gun seems to be firing, I’d specify the message in ActivateGuns like this:

foreach(GameObject gun in guns)
{
    guns.SetActive(true);
    print(gun.name + " is shooting.");
}

I hope your gun game objects have got distinguishable names like “Left gun” and “Right gun”. If that’s the case, observe your console when the right gun seems to be firing only. Before we look for the issue, we need to ensure that the left gun is not firing meaning that the number of messages for the left gun does not increase. If it does increase, the gun is firing and the issue is probably somwhere in the settings of the ParticleSystem. In this case, you could try to enable “Prewarm” and/or to disable “Play On Awake”.


See also:

I isnt gun spefific. If you look at the video the only time one gun is shooting is when im turn so if i turn left only the left one shoots and same for the right but they both shoot when im straight. and both of my guns are named differently

Used the code.

also im using my mouse to show certain times in the video lol

I’m wondering if the issue is an optical illusion or an issue due to the perspective. Try to pause the game with Ctrl + Shift + P when the effect occurs, go to the scene and rotate the view.

Did you try to enable “Prewarm”? And enable “Always Simulate” again without disabling “Play On Awake?”


See also:

1 Like

here is the game pauses. also i marked in blue on the left to show that both of the particle systems are enabled and not off.

and no i havent tried prewarm ill look for it right now.

I couldnt find where Prewarm was but i put on always stimulate without the wake and it looks like it worked. i tried running my games a few times and breaking it and i couldnt. There must have been a part in a lesson where i must not have clicked that lol thank you.

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

Privacy & Terms