Why does it over snap like that despite the raycast being cast on the correct part, considering that the primary part of the grid selection model is in the middle? If you need the code I can send it, but as of now I need a good system on how to implement this. Anyone has ideas?
for every mouse movement. a raycast is made with the mouse as its origin point. It’s then checked if the instance that is being hit is a part with an attribute called “Interactable”. If it’s true, the grid selection model pivots to the part position that got hit. I don’t understand why it’s not working properly when the grid selection goes to a 3 x 3 considering that it works flawlessly when it’s only 1 part. (The primary part of the grid selection model is the middle part of the box)
local raycastresult = workspace:Raycast(mouse.Hit.Position + Vector3.new(0,150,0), Vector3.new(0,-275,0))
Here is where it snaps to the grid: gridSelection:PivotTo(CFrame.new(raycastresult.Instance.Position + Vector3.new(0,raycastresult.Instance.Size.Y/2,0)))