Raycast Components/Specifics

Raycast is causing my chromebook serious lag problems (95.5 ms in metrics) even when it is being used unoften. I’d like to know the specifics of raycast and how it functions on flowlab so my gamejam game is not laggy even on computers that cannot run as well.

1 Like

It really depends on how many Raycasts you use and how long they are.
Another issue is devices will with very little RAM don’t perform well since Flowlab is browser base.

2 Likes

I’m not sure exactly what you are asking - Raycast checks the collision of a one-dimensional line segment across all of the collision shapes in your game world. Shorter rays will generally be quicker to check since they cover a smaller area. Also, the fewer collision shapes there are in the level, the fewer checks need to be made.

In general, a Raycast isn’t particularly slow, but if you are doing lots of them, the time can add up.

95 ms is a lot, however, and this probably indicates that just too many raycasts are being attempted each frame. How many raycast checks are running, and what are they doing? Maybe it’s possible to replace this logic with something faster.

1 Like

16 GB of ram, still lagging on my good computer. I have many 64 length raycasts running a special system in my game.