So i have this grid placement system. I've made it putting a hover script inside EACH BRICK IN THE GRID but it lags the game too much. So i would like to know if its possible to do a multiple hover detector with a few scripts
Movement system: Moves block around if it is not placed yet
local ZPosition = script.Parent.Position.Z
local XPosition = script.Parent.Position.X
local YPosition = script.Parent.Position.Y + 1.019
local Vector = Vector3.new(XPosition, YPosition, ZPosition)
script.Parent.ClickDetector.MouseHoverEnter:connect(function(Player)
workspace.Lava.Position = Vector
end)
Placement script: Places block
script.Parent.ClickDetector.MouseClick:Connect(function()
workspace.Lava.Transparency = 0
workspace.Lava.CanCollide = true
end)
Move cancellator script: Cancels movement if block is placed
workspace.Lava.Changed:Connect(function()
if workspace.Lava.Transparency == 0 then
script.Parent.Move.Disabled = true
end
end)
Please have in mind there's the three scripts in EVERY block in the grid. So the game lags

5 comments
You do realise you could have a ClickDetector in a Model, so you could have all the parts in a model and the click detector would work on the model
but how would it detect each individual hover over each individual brick?
Do you know how to use Remotes? You can make this way more efficient using them
i do but idk how they would apply to this sittuation
fixed the error, try it again