Physics: Ray Cast buffer length and cast suggestions (DEF-2026) (SOLVED)

Got the next problem:

:PHYSICS: Ray cast query buffer is full (64), ignoring request.

There is way to increase buffer length? There is a lot of buffer things can be increased, but raycast is not.

And anyone can explain, how exactly raycasts works inside defold? There is way to instantly get raycast result?

Also, will be good to have other cast types (box cast, sphere cast). To create explosions I now creating a GameObject with sphere collider on 1 frame and delete it. Sphere cast will be great here.

Hello @Insality

The raycast buffers are currently fixed (64 entries for 2D, 128 entries for 3D). They should of course be made configurable through game.project, I’ve created an issue for this (DEF-2026).

How much of a blocker is this for your project?

2 Likes

Thanks, @jakob.pogulis

Now I have 2 raycast 5-10 times in second for every enemy (scanning arounds)
It is not a blocker for me now, but will be great to configure it. Probably, I need to do a many small raycasts in future, so it is can be critical later.

1 Like

Making raycast buffer larger may be pointless. Because every raycast response is a message and we want receive this message in the same frame where we made raycast request. But number of messages per frame is limited.
Raycasting in Defold is a disaster. Why raycasts is coupled with message system? Why there is no response when nothing is hit?
Personally, i think this is a serious design mistake. It prevents implementing some games using Defold. For example, there is impossible for now to implement reliable action-platformer game mechanic in Defold.

Ray cast buffer size has been made configurable in Defold 1.2.102

2 Likes