Raycast going on forever. (how do i set a limit?)

just watch the video for explanation i guess.

since this isn’t working, is there an alternative to setting limits for how far a raycast can go?

KEY

  • Green line represents how far the flamethrower should be able to shoot
  • The range that of which the raycast can shoot SHOULD be 50.
  • The Raycast can shoot way beyond that.

thanks,
-Luke

raycasts don’t have unlimited range

wait, i think i know how to fix this, hold on.

	if (module.firepoint.WorldPosition - result.Position).Magnitude < module.range then