When I try tweening my lights they do a full 360 rotation on any Axis that is the same.
When I tween so that the Handles Y and Z axis goes to 1 spot and the X are always 180 and then when I run the tween it does a 360 spin on the X-axis making it not what I wanted but still ending up where I want the entire thing to rotate to.
local PresetPosition = {
["A"] = {
Handle = Vector3.new(0, 0, 180);
Hinge = Vector3.new(25,0,0);
};
["B"] = {
Handle = Vector3.new(0,-45,180);
Hinge = Vector3.new(90,-45,0);
};
}
for i,v in pairs( workspace["DNTECH PANEL"].LIGHTS:GetChildren()) do
game:GetService("TweenService"):Create(v.HANDLE,TweenInfo.new(0.5,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{Orientation = PresetPosition[Position].Handle}):Play()
game:GetService("TweenService"):Create(v.HINGE,TweenInfo.new(0.5,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{Orientation = PresetPosition[Position].Hinge}):Play()
end
1 Like
local PresetPosition = {
["A"] = {
Handle = Vector3.new(0, 0, 180);
Hinge = Vector3.new(25,0,0);
};
["B"] = {
Handle = Vector3.new(0,-45,180);
Hinge = Vector3.new(90,-45,0);
};
}
for i,v in ipairs( workspace["DNTECH PANEL"].LIGHTS:GetChildren()) do
game:GetService("TweenService"):Create(v.HANDLE,TweenInfo.new(0.5,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{Orientation = PresentPosition["A"].Handle}):Play()
game:GetService("TweenService"):Create(v.HINGE,TweenInfo.new(0.5,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{Orientation = PresetPosition["A"].Hinge}):Play()
end
I believe that would work, though please let me know if I did anything wrong.
1 Like
Nope it didn’t work, it is still rotating the handle on its Z and the Hinge on its Z aswell
Ohh, try using CFrame.X
and CFrame.Y
to get those coordinates, I believe that would work.
Yea but all the axis will move to different ways and need to go to that specific orientation for where it goes
Ah, then I’m afraid I don’t have a solution for you as of right now, sorry!