Raycasting is simply not working?

Hi there,

I’ve been using raycasts for a long time, but now suddenly something very strange is happening.

For some reason I cannot detect if an object is inbetween 2 static points. I really don’t know what’s going wrong here, but I’ll try to explain everything in the video.

1 Like

Does the basepart have CanQuery to true?

1 Like

Yes, all 3 baseparts have CanQuery set to true. I have also figured out some more unusual behavior where the ray suddenly starts hitting:

1 Like

I think i figured it out, your raycastDirection is unit vector with length 1, did you forget to multiply it with a scalar or raycastDistance?

3 Likes

I have figured it out. I simply had to not make the direction a Unit and then it works. I think unit is only useful when you want to extent it to a certain length like .Unit * 300 studs, you know.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.