So i’m trying to make a building game, but when I use Mouse.Hit.Position
something very weird happens. take a look.
here’s the 2 scripts i have
the one that places the block when I click (not shown in the vid):
wait()
script.Parent.Activated:Connect(function(Touch)
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local NewPart = Instance.new("Part")
NewPart.Parent = workspace
NewPart.Anchored = true
NewPart.Position = Mouse.Hit.Position
end)
thing that makes the part that shows where the part will be placed:
script.Parent.Equipped:Connect(function()
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local NewPart = Instance.new("Part")
NewPart.Material = Enum.Material.ForceField
NewPart.CanCollide = false
NewPart.Parent = workspace NewPart.Anchored = true
while true do
NewPart.Position = Mouse.Hit.Position
wait()
end
end)
I’m probably being very stupid with my code because I’m new to it.