Hello all,
So! I’m working on a menu that allows prop manipulation. You spawn in the prop, and then you can rotate and move the prop nearest to you. The spawning part was easy, I’ve done that all but I haven’t been able to figure out the rotation or movement part.
local degrees = {10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360}
local position = {10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360}
-- Rotation --
local rotation = _menuPool:AddSubMenu(manipulation, "Rotation", "Rotates nearest object")
local x = NativeUI.CreateSliderItem("X", degrees, 1, "Rotate on the X axis", false)
local y = NativeUI.CreateSliderItem("Y", degrees, 1, "Rotate on the Y axis", false)
local z = NativeUI.CreateSliderItem("Z", degrees, 1, "Rotate on the Z axis", false)
rotation:AddItem(x)
rotation:AddItem(y)
rotation:AddItem(z)
rotation.OnSliderChange = function(sender, item, index)
rotation = item:IndexToItem(index)
if item == x then
elseif item == y then
elseif item == z then
end
end
So, if you slide the sliders it will rotate the object on the axis slider you used. Unless anyone has a better idea for achieving this, could someone give me some help as to how to achieve this?