We use bodymovers(I use LinearVelocity) to move parts and also models’ rootparts, but it gets harder, when we work with the players. I am trying to make a system where if you hit an enemy, you and enemy will move in some direction, but when i test the movement on dummies they don’t “lag” like players.
The clip: https://i.gyazo.com/2af5b1f7bf35fc791d20e8263f671268.mp4
Here’s the code, but the problem is not rly in it:
local Attachment = Instance.new("Attachment", ehumrp)
local LV = Instance.new("LinearVelocity", Attachment)
LV.MaxForce = math.huge
LV.VectorVelocity = humrp.CFrame.LookVector * 15
LV.Attachment0 = Attachment
game.Debris:AddItem(Attachment, 0.1)
game.Debris:AddItem(LV, 0.1)
local Attachment1 = Instance.new("Attachment", humrp)
local LV1 = Instance.new("LinearVelocity", Attachment1)
LV1.MaxForce = math.huge
LV1.VectorVelocity = humrp.CFrame.LookVector * 12.5
LV1.Attachment0 = Attachment1
game.Debris:AddItem(Attachment1, 0.1)
game.Debris:AddItem(LV1, 0.1)
What i tried to do already:
-
I read alot of other topics and most of them were talking about “optimizing humanoid”(i disabled most of useless humanoid states) and setting network ownership of the part to a player(that helped but not completely. On the enemy’s screen there was no lag, but on my screen there was. And also this method not rly good because for others there still be lag).
-
Some helpers told me to use AssemblyLinearVelocity instead(it is rly smooth movement, but replacing something, won’t fix the problem and it’s not rly good for my type of game, so i don’t want to it)
-
I tried to run the movement on the client(because better physics). I used FireAllClients that uses module for movement(Basically we call this technique "Replicator) and sadly that didn’t help.
-
Set humanoid state to “Physics”(didn’t help)
P.S. If it may better explain what result i want to get here is clip from the game “Anime Battle Arena” that move character very smooth, using BodyVelocity(I don’t need the same thing, i just like the way how it moves): https://i.gyazo.com/77cf3e2b2e4f15cda061f3ce3ffa3445.mp4