My current projectile system right now is pretty basic:
User presses a key —> A projectile is cloned on the client and begins to Tween towards the enemy —> The Server decreases the enemy health and tell all other clients to replicate the projectile. When the projectile tween completes, the hit effect is played and the enemy does his animation. There is also an autotarget feature so there is need to check if the projectile actually hits.
Before, I had no issues with my system since the delay between the client and server was enough so that the enemy’s health decreases roughly around the same time the projectile reaches the enemy. I’m also not too concern with having projectile and damage match up on other clients as I am with matching them up on the client of the player who actually fired the projectile.
But I’m trying to expand my system to include more complex abilities where one ability have multiple projectiles with a short delay between each other(eg. Meteor Shower). With something like this, I want the enemy to take damage upon each projectile and for it to happen the moment the projectile touches the enemy.
I’m struggling to think of a way to do this effectively. If I fired the remote when my tween completes that would solve my problem except there would be huge delay in replicating projectile on other clients. Another way might to just use task.wait() but task.wait() is incredibly unreliable. The best approach I could think of is to fire a remote when the button is pressed to replicate the projectile and another remote when the projectile tween completes. But I’m don’t exactly find myself exactly liking the idea of firing two remotes for one action so I’m asking for inputs on how to best approach this and if I’m being too conservative with my use of remote events.
Thanks and I apologize for any rambling, it’s really late for me and I am not the most articulate right now.