How to detect infinite distances with tween?

To give my beam a sort of bullet look, I used tween to teleport a projectile from a players blast to the point where they clicked. The problem is that when you do infinite distances, such as point to the sky, it goes so fast you can’t see it. I was wondering if there is any way to counter this, or if I should just use raycasts. If I do use raycasts, I don’t know how to get the beginning position and the end position.

Try calculating the time and edit it into the TweenInfo. Distance per second.

Possibly clamping the value to a maximum distance.

But if I do inf/5 for the speed, the speed is inf. If I don’t let people fire at the sky, the firing effect isn’t full. I feel like I should do raycasts, but can’t figure out how to get the beginning of the raycast to the end of it.

Clamping the distance(limiting between two values) might solve it. If the value is inf and you clamp it with 1000, it will be set to 1000/5 instead of inf/5.

Recently, I have been testing with raycasting guns. Adapted the use of FastCast.

1 Like

Ill try that.
ignore this for 30 char

Oh what I did to fix this is first to use Linear EasingStyle and then to control the speed I calculated the distance and divided it by a number, to get a constant speed on all distances.

I also did this, but with a raycast with a set maximum distance.