I have begun developing a basketball game and have naturally found myself trying to think of ways to restrict the basketball's physics to produce realistic results (unlike the madness that ensues when a part is squished and fires a thousand studs away). My current idea includes updating the CFrame of the ball frequently to keep it along clean, trigonometric paths in the air and creating some pre-determined angles at which the ball can fly when motion is interrupted. Currently, I'm struggling to figure out a way around the inconsistencies caused by remote events and manipulation of network ownership to create a game that has as little delay as possible when the ball is transferred from a player's possession to the rest of the court. Any ideas and suggestions are encouraged.
For further clarification, my question is not primarily about modeling projectile motion. The main issue I have is the lag caused by remote events/switching network ownership, and I'm curious to know what other options there are for altering a brick's velocity upon some event fired by a player.
What you could do to reduce lag is to make each client (and the server to prevent people from hacking it to make it at the goal) calculate the paths the basketball is going to be at and each modify the basketball's CFrame to follow it. The server sends what position the basketball is at on its side and if a client's basketball is too far away from the server's position it readjusts it using a tween. When the client wants to move the ball, it should call the server with when the client called it (make sure to use UTC time, not tick and only use tick to get more precise timing below the seconds like tick() - math.floor(tick()) + seconds + minutes*60
and get seconds/minutes using os.date) and the server speeds up the ball by how much time elapsed (but you might want to make a max time it speeds up, like 0.5 second and if there's a 0.6 second difference from when the client called it, it only speeds it up like if there's a 0.5 second difference) to make up for the time difference.
This should prevents hackers from teleporting the ball to the goal since they don't have network ownership, and also makes it smoother by making each client calculate the movement themselves.