Topic: Spawning secondary projectile for particle trails
Dear all.
I hope somebody can help me with this. Basically the situation is that we are creating a fireball type move which has a VFX particle effect for the trails. The problem being is that when the projectile hits, the projectile in the spawn pool is deactivated so all the effects dissappear also. One possible work around I have looked at is spawning a secondary projectile which contains only the trail effects however it does not have any collisions so it will carry on. 2 problems present themselves with this approach
Even if I put the number of hits to 0 on this second projectile, it still registers a hit and this causes problems such as the blocking player freezing. I've also tried reducing blockable and hit areas to 0 with no success.
The trail particles , as expected do carry on through the player and to the other side of the screen.
The information / advice I would like help with is :
Where in the code does it detect if a projectile is hitting the player with a projectile. If I can find this, I can add an additional menu item as a boolean and add an IF statement to say only if this is false, then perform the check. This could then be applied just to the second projectile leaving it free to travel with no chance of registering a hit.
The second piece of advice is that I would like to potentially add an event on the first fireball prefab where on de-activation the trail prefab could have a script listening to that event and at that point set the emissions on the trails to zero and then de-activate after x many seconds (thus leaving it enabled so the pre-existing trails can dissipate naturally). My only concern with this approach is if two players have the same character which casts this same fireball, if the event is detected, it would de-activate both fireball trails that are currently active. I believe there is a unique ID for each projectile, what is the best way to access this to use in an IF statement so that it basically checks if its the correct event for its fireball?
I hope I have explained this clearly, please let me know if you need any further info. If there is a simpler solution, I am also interested in that. Thanks for your help in advice.