You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to make a smoot-looking knockback on all the player’s screens( like most of the front page games that are mainly about combat)
What is the issue? Include screenshots/videos if possible!
It only looks smooth on the victim’s side and always looks choppy on all other clients’ sides. Example: 2022-12-08 16-16-59
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have read tons of other posts about this but none of them have got a good solution. I tried applying different kinds of physics to the victim’s HRP on both local and server scripts, I also tried tweening, but apparently, none of them worked the way I want.
Side notes: I think this happened due to only the client owner of the victim’s character
is calculating the physics. I have just come up with an idea of recreating the victim’s character and then applying physics/tweening on the fake victim character then updating the actual victim character to the position of the fake one. But I still want to see if I can find an actual working method before testing my plan cause I don’t want to waste any more time on this.
Enemy.HumanoidRootPart:SetNetworkOwner(nil) -- before the knockback
-- do knockback
task.wait(0.05)
Enemy.HumanoidRootPart:SetNetworkOwner(EnemyPlayer) -- end of knockback
Other than that you could use the depecrated instance body velocity
I’m not entirely sure but Roblox itself uses setting the network ownership of a whole vehicle as an example. So I doubt they’re would be any big server impacts from it.
– Here’s a quote from the document –
“Imagine a player is throwing an object at another player. As the object travels through the air, it becomes far from the thrower and ownership switches to the server. Once the object gets close enough to the target player, its ownership switches to the target player. Even with a good network connection, there may be visible lag in the movement of the object when the owner switches. The following code samples set ownership of the projectile to the server so that it doesn’t change in motion, preventing visible jumps in movement.”
I have just tested and it still looks more unresponsive/laggy on the attacker side, it was better than the last time but there’s still a noticeable delay on the attacker side at the beginning of the knockback, do you have any idea on how I can fix it?