Hello again, I set up a Particle System for a “rolling pin” attack for my game. I took the whip weapon script for that since the attack is very similar. The problem is that the particle System is not visible when the attack takes place. I know it is happening becuase I can see enemies taking damage and knockback. I did some debug logs and the particle System seems to be active. If I drag the prefab from the folder into the game or menu scene, it plays one time when I start the game, but it is visible then. When instantiated by code however, it is not visible.
Thanks in advance.
When the whip effect is spawned by your script, does it show up in the Hierarchy? If it does, then it is likely that you have to set the Sorting Layer of your whip particle effects to a higher sorting layer.
You can find the Sorting Layer ID property of a particle system in the Renderer module all the way at the bottom.
It doesn’t show up in the hierarchy, the only thing that shows up is the controller, but the particle System itself is never visible, which is strange because the particle system that is responsible for player damage spawns clones that are visible in the hierarchy. I set the Sorting Layer ID to Foreground.
If the whip effect is not showing up in your Hierarchy, it is not being spawned at all. Are there any errors appearing on your Console?
I would check for the following:
Make sure that your Whip weapon has a projectile prefab assigned, and make sure that you have assigned the prefab to it (and not a copy of the prefab on the Scene).
Check and fix any errors in your Console
If the above 2 doesn’t work, your script may have left something out. You can post it here and I’ll have a look at it for you.
By Whip Weapon, you mean the Whip weapon Scriptable Object, right? I have assigned my particle system Prefab in the projectile prefab slot of the Whip weapon scriptable object. The particle effect prefab has the whip weapon script and the projectile weapon script assigned, is that how it should be? Because if the projectile Script is not attached, I cant assign the prefab in the scriptable Object. Unfortunately, I get no errors in my console, I even get spawn positions of the projectiles, but I cant see them. I´ll attach the script but I dont think that that´s the issue. Is there anything else you know of that could make the particle effect attack enemies without showing up in the hierarchy or being visible?