Basically I've created a grid with 36 separate blocks and grouped them together in a model named "Grid" I managed to get over my first obstacle with the help of someone(Rheines) by making a script that would place a block above a section of the grid if the player clicks down on that section, woohoo! So the problem I've encountered is I actually hoped to change it so when the player is hovering over a section of the grid the part displays on that section until the cursor moves to another section in-which it would disappear from the previous and move to the new.
I thought I could do this using a while true loop having it constantly check the position of the players cursor, and then placing a block above that section but I don't know how I'd go about making it so when the player moves to a new section it removes the old block?
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse()
while true do
wait()
local Origin = Player.Character:WaitForChild("Torso")
local ray = Ray.new(Origin.Position, (Mouse.Hit.p - Origin.Position).unit * 500)
local part, hitPosition = workspace:FindPartOnRay(ray, Player.Character)
if part then
if part.Parent.Name == "Grid" then
local Brick = script["Brick1"]:Clone()
Brick.CFrame = part.CFrame*CFrame.new(0,2,0)
Brick.Parent = game.Workspace
end
end
end
