Raycasting to detect terrain?

Well there’s really no reason to do it every frame because the boat doesn’t move at lightning speed. Thats why I said, you could drop it down to 0.1 seconds or just use wait() which will wait around 0.03 seconds. Thats enough to not see any visible difference at all. Running the code even faster only takes up extra performance with practically no improvement.

1 Like

That’s every single frame, precisely what I am saying to use.

I stated why to do this

1 Like

Thats only if the player is running at 30 FPS (which is honestly quite low). And yes I realize what you’re saying about the delay issue but I don’t think it will be visible if ran every 0.1 seconds. I agree 0.5 seconds may be a bit too slow, but I don’t think it should be any lower than 0.1

Either way, its up to @IllustriousEntity how often to run the loop.

2 Likes

Doesn’t matter. Please remain on-topic. These optimisation practices can be discussed with OP privately or you can raise a discussion about this by creating a new thread, not hijacking a thread about detecting terrain from a raycast.

4 Likes

I just don’t understand your reasoning for being lower than wait()… As I said, there’s little to no drawbacks with a huge plus, instant feedback.

2 Likes