I’m trying to make it so you can drag a DModelPanel, however I am having problems with the DModelPanel staying/getting the position of the cursor.
local x, y = dragicon:GetPos()
local mx, my = gui.MousePos()
dragicon:SetPos( mx - x, my - y )
That is the closest I have come to for the DModelPanel to actually get the correct position of the cursor, even then it’s dodgy. Have also tried mx and my, but the DModelPanel’s position seems to go away from the cursor.
Is there a calculation for the DModelPanel to actually stay with the cursor?
tl;dr The DModelPanel doesen’t get the gui mouse position properly.