I can’t seem to figure out what I am doing wrong when it comes to raycasts, I thought I understood them. So I set up two parts to represent the origin and destination of the ray and I put a part in between to simulate a simple situation. I set the origin to the position of the green brick and the direction to the position of the red brick. I thought by doing this it would detect the white brick but it does not. What am I doing wrong here?
local origin = workspace.Origin
local destination = workspace.Destination
local raycast = workspace:Raycast(origin.Position, destination.Position)
if raycast then
print(raycast.Instance)
end