Ideal way to make fireballs?

Hello everyone!
Although fireballs are relatively simple to make (object with body velocity and a .Touched event), I was wondering what the best way to handle such an ability would be.

To explain what my problem is, I will use Ryu’s Hadoken, from the Street Fighter series.
4Jed85U

So, why is the method I mentioned a problem? First of all, I want to handle the animation on the client as well as having the effect synchronized with the hitbox, for a better feeling. This is something the previously mentioned method can not do.

My guess is that I would have to have a listener in both the client and the server, the former handling the effect and the latter handling an “imaginary” hitbox, of sorts.

Most of my doubts are relative to client - server interactions. Still, I would like to hear your thoughts in this matter. Thank you for reading.

If you want stuff to be synchronized I would suggest using cframe instead of bodyvelocity, that way you know exactly where it will be and how much it will move.

I would have the hit detection be local, combined with sanity checks from the server

The effects should also be created locally to comfirm no latency from the local hitbox then just fire remote to server, and have that fire a remote to every other client to replicate the effect

Thanks for the reply,

With CFrame do you mean tweening it?

Do you mean that the fireball should be created on the server? Otherwise how would you track the position for the sanity checks?

Well, at least I was correct in one thing.

You could tween it, I was thinking in more of the lines of

Fireball.CFrame = FireBall.CFrame + FireBall.CFrame.LookVector*Speed
and then just have that in a loop until its destroyed

As for how to track on server, you just simulate the projectile without actually needing the fireball model itself, you can do this by passing it the type of projectile, and then the server can determine the speed of the projectile (from a stats module or something similar) and u can get the position of the projectile by passing it and hten doing a simple distance sanity check to see if the fireball can realistically spawn in that spot

1 Like

Yes, this is what I meant with the “imaginary” hitbox in the original post.

Are there any performance issues with handling the detection on the server? Or is it just have it handle less stuff?

If you do the detection on the server, that just means whenever u see a fireball hit on your screen it can sometimes not actually detect on server due to latency for something like guns this would be very noticeable… not to sure about fireballs

Performance wise, its not really a big deal ur just slightly using more server resources

Alright, thank you so much for the help.