CFrame.lookAt destroys clone

title

function Attack(player)
	local character = player.Character or player.CharacterAdded:Wait()
	local poop = stuffFolder:WaitForChild("Poop")
	local head = character.Head
	
	local newPoop = poop:Clone()
	newPoop.Parent = workspace.Stuff
	newPoop.Position = head.Position
	local cf = CFrame.lookAt(head.Position, newPoop.Position)
	newPoop.CFrame = cf	
end

when I put CFrame.lookAt it doesn’t spawn the clone and I am confused why

Have you tried swapping positions?

function Attack(player)
	local character = player.Character or player.CharacterAdded:Wait()
	local poop = stuffFolder:WaitForChild("Poop")
	local head = character.Head

	local newPoop = poop:Clone()
	newPoop.Parent = workspace.Stuff
	newPoop.CFrame = CFrame.new(head.Position) * CFrame.lookAt(newPoop.Position, head.Position)
end

It spawns quite far away from the player now

1 Like

Could you provide a screenshot so that I can understand what’s going on?

image
here is what happens when it spawns

Did you use the same exact code that I shared? if so, do you have anything else that could be tampering with the position of the part?

I used your exact code and nothing else is tampering with the position as far as i can tell

oh I just fixed it by changing the position from head to torso thank you

1 Like