so this is the raycast
local ray = Ray.new(char:FindFirstChildOfClass("Tool").tool.barrel,pos)
so how would i change this so it only goes one stud?
so this is the raycast
local ray = Ray.new(char:FindFirstChildOfClass("Tool").tool.barrel,pos)
so how would i change this so it only goes one stud?
the Ray.new constructor takes 2 arguments, the starting position, and the Direction where the ray should go.. the magnitude of the direction vector determines how far the ray will go..
therefore, if you wanted a ray to go 300 studs, you'd have to do direction.Unit * 300
if you have the starting position, and an end position, you can get the direction by doing direction = endPosition - startingPosition.. learn more here
NOTE THIS: the constructor doesn't take a starting position, and an end position
This discussion is preserved as it was. New answers, comments, and votes are closed.