I already understand that i shouldn’t send damage values from the client to the server so what ive done is, depending on the move the player wants to do i send the move name to the server from client and then the server creates the corresponding hitbox size, damage and other things but ive realized that its quite slow because when i had jumped and attacked a split second after jumping i can see the hitbox is still at the original position of my character before i jumped which i assume is because the server hasdnt registered that i jumped yet? The reason why im worried about the delay is because i have a specific move that only works when both the player and enemy are in the air and the hitbox keeps on missing the enemy because the enemy is falling too fast so by the time the hitbox is created the enemy is already gone. Another example of when there is a noticeable delay between client and server is when i have a move that brings the player and enemy up into the air at the same time and i would like their height above the ground to be the same at all times but when i create the upwards linear velocity on both the player and enemy on the server both the player and enemy arent at equal distance above the ground since one is higher than the other. So what i was wondering is how do i get around these sorts of delays where instant response is crucial in my pvp game. Should i be doing most of this on the client side? and if so which parts should i be doing on the client and which on the server
Just put everything in the client side and put only the damage on the server, make a simple magnitude check and a debounce. There are way less hackers thx to byfron, just make the experience as smooth as possible for players, don’t worry about cheaters, the chance of success of a game is low anyways.
yeah thats what i ended up doing i just put everything on the client and a cooldown and magnitude check on the server and it ended up becoming way smoother thanks for the reply tho bro