Hello devforum,
It seems that i’ve managed to create my raycast gun with a few hitches:
local function active()
print('e')
local attachment1 = Instance.new("Attachment")
attachment1.Parent = tool.Barrel
local attachment2 = Instance.new("Attachment")
attachment2.Parent = workspace.Baseplate
attachment2.Position = mouse.hit.p
local beam = Instance.new("Beam", workspace)
beam.Attachment0 = attachment1
beam.Attachment1 = attachment2
beam.Enabled = true
local raycastResult = workspace:Raycast(tool.Barrel.Position, mouse.hit.p)
print(raycastResult)
wait(1)
beam:Destroy()
end
this is only the start, but i’d say it’s pretty good; what i’m looking for help on is sending the beam DIRECTLY to the mouse, as my solution makes it sag a bit when i shoot anywhere but empty void
(notice the bottom beams; I was shooting much farther , about halfway the top beams)