I’ve made a system that uses :ApplyImpulse, to move a part called “CharacterController” which moves the players character
But the problem is for some reason the whole game starts glitching and the CharacterController just disappears. Also, when I comment out the code inside the function but not the function it doesn’t glitch anymore.
Heres the code:
RunService.RenderStepped:Connect(function(delta)
if self.MoveVector ~= Vector3.zero then
self.MoveVector = Vector3.new(self.Humanoid.MoveDirection.X, 0, self.Humanoid.MoveDirection.Z)
self.MoveDirection = Vector3.new(self.Humanoid.MoveDirection.X, 0, self.Humanoid.MoveDirection.Z) * (fps * delta) * self.Humanoid.Property.WalkSpeed
self.Humanoid.CharacterController:ApplyImpulse(self.MoveDirection * self.Humanoid.Character.HumanoidRootPart.AssemblyMass)
self.Humanoid.CharAlignOrientation.CFrame = CFrame.lookAt(Vector3.zero, self.MoveVector)
end
end)