Problem with cfarme and cframe.lookat

  1. What do you want to achieve?
    i want the player to teleport to a location and play the animation upon using the proxmity prompt
  2. What is the issue?
    the cframe doesnt teleport the player to the intended loaction but to other loaction
  3. What solutions have you tried so far?
    trying to make a position part but didnt work
-- prox.PromptButtonHoldBegan:Connect(function(player)
	local anime ="Animation")
	anime.AnimationId = "rbxassetid://6996686813"
	playanim = player.Character.Humanoid:LoadAnimation(anime)
	knife.Parent = player.Character
	player.Character.HumanoidRootPart.CFrame =
	player.Character.HumanoidRootPart.CFrame = CFrame.lookAt( -,2,0),
	player.Character.Humanoid.WalkSpeed = 0
	for index , value in ipairs(tableknife) do
		if value:IsA("Part")  or value:IsA("WedgePart") then
			value.Transparency = 1

idk what i did worng can someone help?

Try doing player.Character:FindFirstChild(“HumanoidRootPart”) instead of getting it directly

I would suggest doing:

player.Character:WaitForChild("HumanoidRootPart").CFrame = playercuttingpoint.CFrame

I don’t understand what you are trying to achieve with:

player.Character.HumanoidRootPart.CFrame = CFrame.lookAt( -,2,0),

Why dont u do this?

Cframe are made from position and orientation which is vector3

It should look like this

script.Parent.HumanoidRootpart.CFrame =,spawn.Orientation)

It will then teleport to a position and rotate to rotation

Sry i didnt see that the script is located outside of the character, to fix is just do a same thing like you did but just change a cframe location to my script

I fixed the look at and also the setting of the CFrame

sorry i wasnt online the whole day so i didnt replay early thx anyway