#hitbox delay!!
1 messages · Page 1 of 1 (latest)
be sure to ping me so i can know when a reply comes
you don't. that delay is caused by physics replication delay and network latency. there isn't one magic line you can add to magically "fix" it because nothing is actually broken, it's simply how the internet works. lag compensation and prediction to deal with all kinds of latency is a massive subject and very difficult, not at all for beginners, but if you wanted to just see how in over your head you are by asking this question, well, i guess you can start here: https://en.wikipedia.org/wiki/Client-side_prediction 
Client-side prediction is a network programming technique used in video games intended to conceal negative effects of high latency connections. The technique attempts to make the player's input feel more instantaneous while governing the player's actions on a remote server.
The process of client-side prediction refers to having the client locall...
yeah this is why hitboxes suck in most roblox games. they didn't just forget to switch on a magic tickbox that reads "fix crappy hitboxes so they are epic and accurate", in reality it's because they are extremely difficult to make. for your game the only thing you can really do is accept that your hitboxes will be just as trash as everyone else's.
A tragedy… 
Move the hitbox to the client and have the server verify the hit was valid based off the attackers position and the defender's position.
Edit: I would add more checks than just the one I suggested.
You can use client sided prediction if you want a really secure hitbox system however if you are just starting out the method I suggested would be a lot easier to setup and more than likely give you acceptable results.
Additionally, I wouldn't use RunService rather weld to the humanoid root part. If you do want to use RunService make sure to disconnect the connection after you're done to avoid memory leaks.
Local conn
Conn = RunService[Whatever]:Connect(function()end)
Conn:Disconnect()
Or use the runservice bind method.