Check out this game, if you equip the tool, click on a cell that is the same color as your teamColor, then you should get a part following your mouse. I tried to do something like this, and here's what i got:
player = game.Players.LocalPlayer
mouse = player:GetMouse()
laser = Instance.new("Part",workspace)
laser.Anchored = true
laser.CanCollide = false
laser.TopSurface = "Smooth"
mouse.Move:connect(function()
wait()
local mag = (mouse.Hit.p-game.Workspace.Part.Position).magnitude
local ray = Ray.new(
game.Workspace.Part.Position
)
local part,pos = game.Workspace:FindPartOnRay(ray)
laser.Position = pos-Vector3.new(0,.4,0)
laser.Size = Vector3.new(1,1,mag)
end)
So two questions:
how do I get the direction
how to I get one end of the part to stay on game.Workspace.Part?
