CFrame lag or CFrame delay?

So I’m making a move and I adjust the player’s CFrame that is nearest to me, and when I’m standing still it moves the player correctly, but when I’m moving it moves the player incorrectly.

Video

Script

local Particles = require(game.ServerStorage.Particles)
local Hitbox = require(game.ServerStorage.Hitbox)

game.ReplicatedStorage.t.OnServerEvent:Connect(function(Player)
	local Character = Player.Character
	local Kick = Character.Humanoid:LoadAnimation(script.Kick)
	Kick:Play()
	
	Particles.AkumaFeet(Player, false)
	
	local Hit
	for i,v in pairs(workspace:GetChildren()) do
		if v:FindFirstChild("Humanoid") and v ~= Character then
			local check = v.Humanoid:GetState()
			if check ~= Enum.HumanoidStateType.Dead then
				if (Character.HumanoidRootPart.Position - v.HumanoidRootPart.Position).Magnitude <= 7 then
					Hit = v
				end
			end
		end
	end
	if Hit ~= nil then
		
		Character.HumanoidRootPart.Anchored = true
		Hit.HumanoidRootPart.Anchored = true
		
		local KickHit = Hit.Humanoid:LoadAnimation(script.KickHit)
		KickHit:Play()
		KickHit:AdjustSpeed(.82)
		Hit.HumanoidRootPart.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -3)
		Hit.HumanoidRootPart.CFrame = CFrame.lookAt(Hit.HumanoidRootPart.Position, Character.HumanoidRootPart.Position)
		
		spawn(function()
			for i = 1,3 do
				if i == 1 then
					wait(.25)
				end
				Hitbox.TakeDamage(Hit, 20, false)--  + script.Parent.GraceAdd.Value)
				Particles.Hit(Hit)
				wait(.55)
			end
		end)
		
	end

	Kick.Stopped:Wait()
	Particles.AkumaFeet(Player, true)
	Character.HumanoidRootPart.Anchored = false
	if Hit ~= nil then
		Hit.HumanoidRootPart.Anchored = false
	end
end)

I really need help on how to fix this.

You could either set the “WalkSpeed” property of the player’s humanoid instance to 0 (thus making them stand still) or similarly you could anchor the HumanoidRootPart of the player’s character model (both of these solutions will prevent the character from moving while an action is being performed). Once the action has completed you can reset the “WalkSpeed” property back to normal (which by default is 16) or unanchor the HumanoidRootPart of the player’s character.

The server is teleporting the Dummy to the character’s position that is on the server. Pretty hard to explain but the fault is on ping.

To fix this, just get the position data from the client (through the remote). Though it may be a security risk (unless you use my anticheat (blatantly advertising))

I might be wrong though.

1 Like

i already do this in the script