Stuttering Replication with LinearVelocity

With the deprecation of BodyVelocity, you need to use LinearVelocity to do pretty much anything related to knockback. However, when I apply a LinearVelocity onto a player character from the server, the position of the character seems to stutter and suddenly snap on everyone else’s perspective (including the server) except from the perspective of the player being knocked back, until the LinearVelocity is destroyed.

Example:

Meanwhile, if I use a BodyVelocity:

Although the replication of the character’s position to the server should be smooth, the usage of a LinearVelocity seems to make it stutter, while the BodyVelocity replicates much more smoothly. Additionally, when the LinearVelocity is created on the client, the position is replicated smoothly as well.

Is this just a bug with LinearVelocity itself?

2 Likes

You could use ApplyImpulse instead of linear velocity

1 Like

The problem is that ApplyImpulse just applies an instant force to an object and the velocity isn’t constrained, so applying an impulse to an object that’s in the air would send the object flying way further than an object on the ground.

1 Like

Alternatively, could you do everything on the client instead of the push on the server?

Yeah, I guess. I’ll probably just do that or use BodyVelocity until LinearVelocity is ever fixed

2 Likes

I found out that this is because you are applying and deleting the LV to the character. Instead, keep it on the character and just increase the max force and then set it to 0 etc.

2 Likes

You’re right, can I ask how you figured this out? and if its ok to delete it after a couple of seconds?

Ugh changing the maxforce to 0 just seems so skimpy