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:
1 | local Ray = Ray.new(game.Workspace.Part.CFrame.lookVector.unit, --the ray will start at this part |
2 | game.Workspace.Part.CFrame.lookVector.unit) --Ray will come out of the front |
3 |
4 | local hit,position = Workspace:FindPartOnRay(Ray,_) |
5 |
6 | print (hit.Name) --print name of thing that the ray hit |
Why did I get this error and how do I fix it?
.new That's the problem. I mean what does Ray.new mean i dont get that little chunk :l