Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with rays?[Not fixed]

So I saw this tutorial on the wiki that showed about raycasting,so then I tried to do my own raycasting and I got a error saying:

18:21:54.179 - Workspace.Script:1: bad argument #2 to 'new' (Vector3 expected, got number)

Script:

local Ray = Ray.new(game.Workspace.Part.CFrame.lookVector.unit,--the ray will start at this part
game.Workspace.Part.CFrame.lookVector.unit)--Ray will come out of the front

local hit,position = Workspace:FindPartOnRay(Ray,_)

print(hit.Name)--print name of thing that the ray hit

Why did I get this error and how do I fix it?

1 answer

.new That's the problem. I mean what does Ray.new mean i dont get that little chunk :l

1 comment

0

Ray.new is making the ray

This discussion is preserved as it was. New answers, comments, and votes are closed.