UIS.InputBegan:Connect(function(input, gpe)
if UIS:IsKeyDown(Enum.KeyCode.R) then
local Oval = game.Workspace.Ignore:WaitForChild("SelectBox").OrientationVal
Oval.Value = Vector3.new(Oval.Value.X, Oval.Value.Y + math.rad(90),Oval.Value.Z)
print("ROTATED")
end
end)
UIS.InputBegan:Connect(function(input, gpe)
if UIS:IsKeyDown(Enum.KeyCode.T) then
local Oval = game.Workspace.Ignore:WaitForChild("SelectBox").OrientationVal
Oval.Value = Vector3.new(Oval.Value.X + math.rad(90), Oval.Value.Y,Oval.Value.Z)
print("ROTATED")
end
end)
UIS.InputBegan:Connect(function(input, gpe)
if UIS:IsKeyDown(Enum.KeyCode.Y) then
local Oval = game.Workspace.Ignore:WaitForChild("SelectBox").OrientationVal
Oval.Value = Vector3.new(Oval.Value.X , Oval.Value.Y,Oval.Value.Z + math.rad(90))
print("ROTATED")
end
end)
My problem is that the rotation values given by the script are relative to the part, how can i prevent that?
Well I see. I am still not entirely sure what exactly your problem is however I could suggest a few changes that you could try and use to get a different outcome.
One might be to use CFrame:ToWorldSpace(CFrame.Angles(0,0,0)) for a rotation that is relative to itself.
You also have to realize that CFrames are not comutative that is A* B does not mean B * A.
I understand that you are not using CFrame however I believe that you really should as it is more powerful than the standard orientation and you can choose whether you rotate in object space or in world space.