When I change the orientation with CFrame.new(Vector3) * CFrame.Angles(Vector3)
, he fix the player flick the player position.
Script
local P1Char = script.Parent
local P2Char = game.Workspace:WaitForChild('Enemy')
local BG = Instance.new('BodyGyro')
BG.Parent = P1Char.HumanoidRootPart
while wait(0.2) do
if P2Char.HumanoidRootPart.Position.X > P1Char.HumanoidRootPart.Position.X then
if script.Parent.HumanoidRootPart.Orientation.Y ~= -90 then
P1Char.HumanoidRootPart.CFrame = CFrame.new(P1Char.HumanoidRootPart.Position) * CFrame.Angles(0, -90, 0)
end
else
if script.Parent.HumanoidRootPart.Orientation.Y ~= 90 then
P1Char.HumanoidRootPart.CFrame = CFrame.new(P1Char.HumanoidRootPart.Position) * CFrame.Angles(0, 90, 0)
end
end
end
VIDEO: