Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i move a block and ignore the X axis from A CFrame?

Hi i want to translate that part but i wan't it to ignore the X axis i tried

local x, y, z = CamPart.CFrame:toEulerAnglesXYZ()

local CorrectedPosFrame = (CFrame.Angles(0, y, z) + CamPart.CFrame.p) * CFrame.new(0, 0, -0.1)

CamPart.CFrame = CorrectedPosFrame

Here is a picture of what i mean : https://prnt.sc/idx33k

1 answer

  HasToStopMovingY = false  
repeat
     wait()
     local x, y, z = CamPart.CFrame:toEulerAnglesXYZ()
     local CorrectionAngleCFrame = (CFrame.Angles(0, y, z) + CamPart.CFrame.p) *
CFrame.new(0, 0, -0.1)
     local CorrectedPosFrame = (CFrame.Angles(x, y, z) + CorrectionAngleCFrame.p) * CFrame.new(0,1,1) 
    CamPart.CFrame = CorrectedPosFrame
until HasToStopMovingY == true

This discussion is preserved as it was. New answers, comments, and votes are closed.