In my combat system on the third hit, the entity is ragdolled then a bodyvelocity is instanced serversided. However, during the start the entity is delayed and frozen for a slight moment before being knocked back. When the player is ragdolled the networkowner of all its parts are set to nil (the server).
If this “entity” is a player character, you should handle ragdolling on their client, as they have full network ownership of their own character
If its an NPC, I might suggest setting the network ownership of the NPC temporarily to the client whacking the NPC. It comes with its risks but might, in the end, be beneficial to the gameplay experience
Setting network to the server is priority as it allows me to set the humanoidstate of the npc.
Does roblox not allow you to set the humanoidstate on the client owning the NPC?
I mean it wouldnt surprise me if robloxs horrible humanoid scripting prevented this
Not actually sure, but I think you need to set the network owner for the NPC to the client to set the humanoid state which defeats the whole purpose of my ragdoll mechanism. My ragdoll module works for both NPC and clients. Also, setting it in a client script can easily be altered by exploiters.
I mean roblox by default dishes out almost any physical object to clients
Im not sure thered by an easy solution to this, and the lag may even be caused by roblox waiting to transfer the ownership of the NPC to the server so it can change it
I would have to know more about how youre doing it exactly though to say anything conclusive about it
I have a question, if the network ownership is nil then I set it to nil again will it have an impact on lag? Because I have a serverscript that checks if the player is ragdolled then I set their character ownership to nil.
Thats a good question, I would try only setting it once and seeing how the results are different
Theres a good chance humanoids mess with network ownership internally, so you might even want to print :GetNetworkOwner() in your tests
Oh dang, so by default my client is the networkowner and is constantly conflicting with the server. Any ideas on how I should solve this? (The NPC’s networkowner)
A classic example of horrible humanoid code, they must have some internal separate processor for network ownership
If you set it to nil it should be taken off of the default automatic network ownership
I might try just doing additional testing, setting network ownership to the server, client, etc and seeing how it behaves and if it can be wrangled into doing something even a little bit useful
Im not so sure theres an ideal solution in this case and you might have to make a few shortcuts
(This is why I avoid humanoids as much as I can)
Alright, thanks for your replies appreciate it. I might have to resort to CFrame’d knockback.
Sorry to disturb you but, i’ve fixed the stuttering by setting network of the NPC to the player when being flung. But in rare occurances bodyvelocity doesn’t seem to move the NPC and player lag just breaks the flinging.