Need help with raycasting

I have currently been trying to make a raycast script, but have had no luck with it. What I want is for the raycast to connect to 2 points(positions) and to update frequently, or if possible, update when intersected. If anyone knows how to do this, please let me know.

1 Like

I know how all that works. What I’m having trouble with is that its not making a raycast from the 2 positions given.

1 Like

Never mind I got it to work. But how can you update a raycast?

1 Like

What I’m wondering is if there’s some way to fire a function if the raycast is intersected by a new part.

Use workspace:Raycast in a loop and check if it returns an instance

1 Like

Ok, I think that will work. I’ll give it a try.
Edit: yes, that does work.