CFrame.lookAt breaks position

  1. What do you want to achieve? i want to have a model point towards a player.

  2. What is the issue? using lookAt causes the whole model to be offset.
    image

  3. What solutions have you tried so far? i’ve tried using different CFrame methods, setprimarypartcframe

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

for i,v in pairs(list.alivePlayers) do
	local char = workspace:FindFirstChild(v)
	print(char)
	object.Parent = workspace
	object.PrimaryPart = object.Head
	object:PivotTo(CFrame.lookAt(object.Head.Position, char.Torso.Position) * boss.Torso.CFrame)

this probably has an absurdly obvious answer that ive spent too long coding to figure out

your multiplying the CFrame. This shifts the model; deleting it should fix the problem.

for i,v in pairs(list.alivePlayers) do
	local char = workspace:FindFirstChild(v)
	print(char)
	object.Parent = workspace
	object.PrimaryPart = object.Head
	object:PivotTo(CFrame.lookAt(object.Head.Position, char.Torso.Position))

problem is if i do that the attacks always start at the same position, and not at where the boss is
edit: nevermind, fixed it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.