I've found an axis tool that is great and it works nice but It literally only grabs parts, like if a model had 2 parts it would grab only one part and not the full model, how would I get this to work with not just the parts but also grab models? I can't find the area in the code that states what its grabbing
local Tool = script.Parent
enabled = true
local selectionBox
local moveHandles
local selectedPose
local previousCFrame
local previousDistance
function onMoveHandlesDown(normal)
print("handlesDown")
if selectedPose then
previousDistance = 0
end
end
function onMoveHandlesDrag(normal, distance)
if selectedPose then
local delta = distance - previousDistance
translation = CFrame.new(Vector3.FromNormalId(normal) * delta)
selectedPose.CFrame = translation * selectedPose.CFrame
previousDistance = distance
print(selectedPose.Position)
end
end
function onButton1Down(mouse)
print("3DButtonDown")
selectionBox.Adornee = nil
moveHandles.Adornee = nil
if mouse.Target ~= nil then
if not mouse.Target.Locked then
selectedPose = mouse.Target
selectionBox.Adornee = mouse.Target
moveHandles.Adornee = mouse.Target
end
end
end
function onEquippedLocal(mouse)
local character = script.Parent.Parent
local player = game.Players:GetPlayerFromCharacter(character)
mouse.Icon ="rbxasset://textures\\DragCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
selectionBox = Instance.new("SelectionBox")
selectionBox.Color = BrickColor.new("Cyan")
selectionBox.Adornee = nil
selectionBox.Parent = player.PlayerGui
moveHandlesPart = Instance.new("Part")
moveHandlesPart.Name = "MoveHandlesProxyPart"
moveHandlesPart.Size = Vector3.new(2,2,2)
moveHandlesPart.Parent = player.PlayerGui
moveHandles = Instance.new("Handles")
moveHandles.Style = Enum.HandlesStyle.Movement
moveHandles.Color = BrickColor.new("Neon orange")
moveHandles.Adornee = nil
moveHandles.MouseDrag:connect(onMoveHandlesDrag)
moveHandles.MouseButton1Down:connect(onMoveHandlesDown)
moveHandles.Parent = player.PlayerGui
end
function onUnequippedLocal()
selectionBox:Remove()
moveHandles:remove()
end
Tool.Equipped:connect(onEquippedLocal)
Tool.Unequipped:connect(onUnequippedLocal)

1 comment
Where do you see Part.CFrame = ?