Log in to vote

Laser pointer dosent work?

Asked by 7 days ago

I am trying to make a laser whitch would stop at certain point were it is blocked by a part.

local origin = script.Parent.Position
local direction = workspace.HUB
local params =
local result = workspace:Raycast(origin, direction)

if result then
    local distance = (origin - result.Position).Magnitude
    local p ="Part")
    p.Anchored = true
    p.CanCollide = false
    p.Size =, 0.1, distance)
    p.CFrame = CFrame.lookAt(origin)*, 0, -distance/2)
You should include what the problem is, now you're just giving us a script and telling us it isn't working. What happens? Do you get any errors? What do you want it to do? Spjureeedd 363 — 6d
can you copy and paste an error you get from the developer console (if you get any)? it's one of the best ways for me to solve errors NGC4637 227 — 6d

Answer this question