Ad
Log in to vote
0

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

Asked by
Simnico99 106
7 days ago
Edited 7 days ago

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

Log in to vote
0
Answered by 7 days ago
Edited 7 days ago
  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

Ad

Answer this question



Ad