boyparis
(B0re4li5)
May 9, 2021, 5:37pm
#1
So, I am making a script that sets the part orientation through CFrame in YXZ order because otherwise the values see to mess up a bit, this is the script
block.CFrame = CFrame.new(endPos) * CFrame.fromAxisAngle(Vector3.new(0,1,0) , math.rad(block.OrientationVal.Value.Y))
block.CFrame = CFrame.new(endPos) * CFrame.fromAxisAngle(Vector3.new(1,0,0), math.rad(block.OrientationVal.Value.X))
block.CFrame = CFrame.new(endPos) * CFrame.fromAxisAngle(Vector3.new(0,0,1), math.rad(block.OrientationVal.Value.Z))
Am I using FromAxisAngle right? if not then how would i do that?
Soliform
(Soliform)
May 9, 2021, 9:02pm
#2
you can just do
block.CFrame = CFrame.new(endPos) * CFrame.Angles(math.rad(block.OrientationVal.Value.X), math.rad(block.OrientationVal.Value.Y), math.rad(block.OrientationVal.Value.Z))
boyparis
(B0re4li5)
May 9, 2021, 10:30pm
#3
That makes it so the angle is done in XYZ order, I need it to be YXZ order
Soliform
(Soliform)
May 9, 2021, 10:34pm
#4
block.CFrame = CFrame.new(endPos) * CFrame.fromEulerAnglesYXZ(math.rad(block.OrientationVal.Value.Y), math.rad(block.OrientationVal.Value.X), math.rad(block.OrientationVal.Value.Z))
2 Likes