CFrame Can't Change Position And Rotation?

I’m trying to make it so when you click a part you get teleported in a specific angle and position, and your controls are disabled aswell.

But when i try to teleport it only changes the position and not the orientation

local Click = game.Workspace.Map.Barn.SliceTrigger.ClickDetector


Click.MouseClick:Connect(function()
	local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()
	local player = game.Players.LocalPlayer
	local characterplayer = player.Character
	local humming = characterplayer:FindFirstChild("HumanoidRootPart")
	
	controls:Disable()
	wait(0.1)
	humming.CFrame = CFrame.new(-157.298, 9.5, -81.961) and CFrame.Angles(0,math.rad(90), 0)
	wait(.2)
	
end)

You need to use * as you’re multiplying the cframe, not and.

2 Likes

cody’s answer is right.

This is unrelated but you should use something like a part’s position to get the teleport position, that way in the future you can change it easily, instead of manually typing in the coordinates. This will also still work if you map moves or rotates at all.

2 Likes

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