[UNSOLVED] Slope rotation only working one way?

Please help! its working perfectly fine one way but as soon as the slope is rotated another way it doesint work!

This is a video of the problem.


Its only working on that one slope rotation.
My only guess is that its not keeping the same y rotation? wich i dont get.
Im not TOO good with cframes so can someone help me?

Heres my code

Angle += tGoAng
		
local redBlock = plrPart

local targetPosition = plrPart.CFrame.Position + downRay.Normal*2

redBlock.CFrame = CFrame.new(redBlock.CFrame.Position, targetPosition)

local rotatedCFrame = CFrame.Angles(math.rad(-90), Angle, 0)
redBlock.CFrame = redBlock.CFrame:ToWorldSpace(rotatedCFrame)

Angle is just the Y angle of the plr part.

Yes i did steal this from “Understanding CFrames”
Which is here → Understanding CFrames (roblox.com)

But yeah thats my problem.
What am i doing wrong?

2 Likes

Sorry i’m very early on to developing in ROBLOX studio but did you mention the other angles? X,Y,Z

2 Likes

Yup he did, CFrame.Angles(math.rad(-90), Angle, 0)

2 Likes

knew it since in his version he tried to make it his own but forgot the other axis

2 Likes