Alright, I'll explain this once.
I have a custom character, I have removed the original ROBLOX character, that walks around, moves limbs and stuff, and added my own character that slides around on the ground, and shoots stuff.
I'll call the character a Tank.
The tank is moving faster (not much faster) on the client than the server. The problem is, when the client goes to shoot, on the client it looks as if the bullet is going through a pellet. Now, on the server it looks as if the client is in a totally different position than the client, since the client is going faster than the server can.
I CAN delay the client and wait for the server to catch up, but that would defeat the purpose of me going through all the work to create no input lag on the client. I am trying to make the server predict where the tank should be on the client. The problem is, I don't know how.
I have the client's ping, in seconds, but I don't know what kind of algorithm is used to predict where the position of a bodyPosition should be after a time. Any help would be appreciated, I am very stuck!
Please, ask questions, or DM me on Discord @Dalition#3531
The game link is: https://www.roblox.com/games/492336478/Diep-rblx
You'll see what I'm talking about.
Doing proper server-authoritative character networking is not an easy challenge. I recommend you check out Fast-Paced Multiplayer, which goes into the details of how to implement something like this. Luanoid, Lua humanoids implemented completely in Lua, may also come in handy for this. As a further resource, Multiplayer Game Programming, Chapter 8, reviews some of the material also described in the Fast-Paced Multiplayer article.
Valve has a helpful resource on latency compensation methods they use for their games, and there was a GDC talk called "I Shot You First: Networking in Halo Reach" that may further assist you.
This is not a beginner's problem, and will likely take a competent programmer.
When it comes to BodyMovers, you can just give network ownership to the tank. This will treat the tank the same as how default characters are treated, where its movements are automatically replicated and synced with the server when edited through a LocalScript. As long as the tank is unanchored, alterations to its position/rotation through BodyMovers and such will replicate just like the character, only requiring you to control it through a LocalScript. However, doing this leaves the tank vulnerable to exploiters (in the same way that characters are), thus requiring you to add appropriate server-sided checks.
Hope this helps!