Linear Velocity STILL Lagging

I’m making a combat system similar to games like Deepwoken or type soul. On the last hit I want a knockback effect and am using linear velocities to do it. However this creates a laggy knockback. This is my second time posting (click here for the first post + videos) and I can’t seem to figure it out no matter what I do.

Things I’ve Tried:
-Other physics processes (applyImpulse, bodyVelocity, etc.)
-Cframe or Positional movers
-Network Ownership (Causes other players besides the attacker to still see the lag)
-Using AI to figure it out
-My own brain

If you know ANYTHING that could help please let me know.

2 Likes

If you have properly attempted all those methods, then I reckon it’s an issue regarding the client’s latency with the server, since the action of pushing is requested to be done in the server through a RemoteEvent.

I see that you have attempted to make it work with the network ownership, however, I feel compelled to ask, whether your attempt was done overriding the push from the RemoteEvent, to the client itself? Since, if you change the dummy’s network ownership to the client, but still invoke the push through a RemoteEvent, then the ownership set is completely redundant.

Aside from the aforementioned, other players seeing the lag is part of the latency. You can’t bypass that since it’s the player’s connection to the server.
If the lag is removed locally for the player under your network ownership configuration, then that’s the apex of what you may accomplish on your side, since replication is handled directly by Roblox.
Unless, theoretically, you find a way to delay the animations and place them in the same replication stack as the dummy push (if that behavior was on the client, there shouldn’t be a reason why they’re not synchronized in the view of server/other clients, henceforth my question above).

1 Like

What do you mean by overriding the push from the RemoteEvent? The way I did it was that the client runs the hit detection, fires to the server, then the server calls the gettingHit function which itself calls the push function where the dummys ownership is set to that of the attackers client.

Also one thing I don’t understand, is that if you wait about 30 seconds before attacking or attack continuously for 30 seconds the bug fixes itself, and the knockback smooths out. This makes me believe it may be a loading bug or something but I’m not sure.

Exactly avoiding all that firing which exasperates latency issues.
The ownership should be set since before, exactly to avoid the call at the moment, and generate latency lag.

Now, since when before? Perhaps since the player starts attacking that NPC, so by the time it’s pushed, the ownership is already of the client, as explained above.

Perhaps there is, by some kind of cache from a past replication kicking in.

Agree with @safeLast120, this sounds like a network latency thing. You probably were overriding any network ownership changes you made depending on how you specifically implemented the system. Like for example I found that if I set an enemy NPC’s model’s parent to nil, but never call Destroy, its network ownership is set to Roblox default settings on respawn. Haven’t found that one documented on the wiki yet, had to trial and error it.

Also-

This also supports the issue being with Network Ownership. Your character has a radius around itself which it can obtain Network Ownership of unanchored parts. Anything that is being simulated on the server and comes into your range comes under your control. Your range starts at 0 (i.e. just your character) and slowly increases each second your in a server. It’s quite literally a sphere that grows around you. After 30 seconds, your network ownership range is large enough that you aren’t knocking the dummy out of range with the knockback, and so you retain ownership the entire time. The stuttering happens when a part changes network owners. No owner change means no stutter means “the bug fixes itself”.

1 Like

I figure it out here, not sure how it works though.

basically its sets the network owner ship for .5 for dummys
thats will prevent the lag but u shoudn’t do it it for players thats will lags them without knockback for dummy setnetworkownership for players u cant do anything about it since its roblox replication

so u cant really do anything about it except for dummy even tsb and alot of big game have this problem.

yeah well it doesn’t seem like it will lag on players at all since their clients seem to run the physics process smoothly even when viewed from other clients. I just dont really get how it works exactly. I set the attacker to own it, then do the push and then after 0.5 seconds it sets it back to the server.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.