Hello! Below I have a CFrame that is used to teleport a player to a specific brick if they die. I wrote it from a tutorial, and now when I die, I face a random direction on the brick I am teleported to, which does not make my game work well. How can I fix this so that I face forward when Cframed?
The Y orientation is calculated by the second value, but you are converting an angle to radians. Just get rid of the math.rad in the Y value and in the math.rad(90): CFrame.Angles(0, TempCheckpoint.Orientation.Y + 90, 0)
I suspect your problem lies in the fact you are setting the position based on the orientation of target part. I am not an expert on CFrames so happy to be corrected but as I understand it the first argument to the CFrame constructor is just about the position in the world, the rotation is controlled by a second parameter. So rather than multiply the new position by the calculated Angle you should use the rotation parameter of the constructor to set the direction they face.