This is my first post on the forum so sorry if it’s not up to the standards
I’m making a client sided projectile and I’m having trouble with the body velocity this is the error I get: attempt to index nil with ‘Hit’
And this is what happens: https://gyazo.com/10243f8826e6d370a585c2e717a000a7
I’m trying to make the projectile shoot from the person who shot the fireball’s mouse but I have to update the mouse position
I’ve tried a lot but nothing works I’ve also tried looking for answers here and other places but found nothing
Have the client that is casting the ability :FireServer() their mouse.Hit.p.
Make the server sanity check however you want to, then :FireAllClients() the sanity-checked position and instructions to make a fireball, or whatever projectile you’re trying to make
Clients will receive the instructions and position and replicate the projectile properly
Keep in mind that you will need to make a good system that accounts for latency for players with poor connections
So wait, it follows the cursor? You’ll want to have something that keeps track of active fireballs on the server and another remote that will update the velocity accordingly. You should also make sure the mouse doesn’t count the Fireball when hovering using TargetFilter
No I have 2 fireball attacks one shoots 6 fireballs and the other one shoots a fireball after 1 second or so so if I were to send the mouse position once all the 6 fireballs would all shoot the same direction and if I were to shoot the normal fireball and you moved your mouse before the 1 second has passed you’ll shoot it in the direction your mouse was once you shot it
You should set network ownership to the player firing the projectile as well, this will avoid spikes in the projectile. This can be done with a server-script.
Use a localscript to get the mouse and whatever you need, then let the server-script know when to fire and give the player network ownership.