I want to make the Display part go on top the of the target but instead it goes inside of it how,would I fix this and why does it do it?
Tool = script.Parent
Handle = Tool.Handle
Player = game.Players.LocalPlayer
Camera = game.Workspace.CurrentCamera
---------------------------------
function CreateDisplayPart()--Creates DisplayPart
local DisPart = Instance.new("Part",Camera)--Hides it from players
DisPart.Anchored = true
DisPart.CanCollide = false
DisPart.Transparency = 0.5
DisPart.Name = "DisplayPart"
DisplayPart = DisPart
end
---------------------------------
Tool.Equipped:connect(function(Mouse)
---------------------------------
DisplayPart = Camera:FindFirstChild("DisplayPart")
if not DisplayPart then--If not found then makes it
CreateDisplayPart()
end
Mouse.Move:connect(function()
Mouse.TargetFilter = DisplayPart
if Mouse.Target then --If not nil then do the following
DisplayPart.CFrame = CFrame.new(Mouse.Hit.p)* CFrame.new(Mouse.Target.CFrame.p)
end
end)
end)

3 comments
Will it be better to use rays and why did you divide the target's size by 2?
No, don't use rays for this, and I divided the target's size by two because the Position of items in 3D space are defined by the center of an object. To get the center of one object to be at the right spot above another object, you have to add together half of each brick's height.
Oh I also replaced line 24 with the code you gave me and I got a error and I don't know how to solve it line 25: ')' expected (to close '(' at line 24) near 'end'