So, I was doing my Viewmodel system and I was trying to do a system for the Tool position and orientation at the viewmodel.
I tried to use CFrame.Angles
and CFrame.fromEulerAnglesXYZ()
but yeah, still getting the wrong Orientation.
This is the part of the script that changes the Motor6D C0 Orientation
local X, Y, Z = VMModel:WaitForChild("Handle"):WaitForChild("GripWeldValue"):GetAttribute("X"), VMModel:WaitForChild("Handle"):WaitForChild("GripWeldValue"):GetAttribute("Y"), VMModel:WaitForChild("Handle"):WaitForChild("GripWeldValue"):GetAttribute("Z")
local weldCFrame = CFrame.new(Vector3.new(0, 0, 0)) * CFrame.Angles(math.rad(WeldValue.Position.X), math.rad(WeldValue.Position.Y), math.rad(WeldValue.Position.Z))
weldCFrame = weldCFrame + Vector3.new(0, -0.3, 0) -- ajuste de posição para se encaixar melhor com a mão do personagem
weldCFrame = weldCFrame * CFrame.Angles(math.rad(60), math.rad(-90), math.rad(120))
Weld.C0 = weldCFrame
- The
X
,Y
andZ
are Attributes of the CFrame value in the script.
Also, instead of using them, I tried to put the numbers, but i got the same result after all.
The Orientation Attribute is not being used
Here’s a visual demonstration of the error
- What i’m getting
Orientation =0.5, -89.996, 60.5
.
- What I should be getting
Orientation =60, 90, 120
Any help is welcome!