Tower doesn't fire

Hello! Since we try to find the closest target, my weapons doesn’t fire. I have already debugged my code, emission is on, Attack() is called but anyway it doesn’t working properly. It fires once or twice and then changes the target and doesn’t fire. I can’t understand the logic behind this behaviour.

Maybe anybody as the same problem?


Welcome to our community! :slight_smile:

Maybe the problem is not in your code but in the particle system. There is no error message in your console when your tower stops shooting? If there isn’t any, please check the settings of your particle system. Maybe it is not able to shoot more than two particles.

There is no mistakes in particle. I have also downloaded the original particle from GitHub resources - they were identical and both don’t fire.

Have no idea what can be the reason.

How do you know that? Did you test that? If so, how?

For testing purposes place a tower in your scene while the game is not running, select its game object with the particle system. In the scene window, there should be a little context window for the particle system click the play button to see if the particle system starts emitting particles. If it does, the configuration is very likely fine.

You could try to enable “Prewarm” in the main module of the particle system.

And if that did not help either, please share your relevant code as formatted text, so I can take a look at it.

Thank you for your attention, Nina!
Yes, particles were emitting when it was separate and I’ve found the reason - in a playmode my tower was emitting particles not horizontally, but vertically. I have changed the direction of the weapon and it helped.

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

Privacy & Terms