The game is access-violating me in both: delphi and fpc compilations, whenever I call the PhysicalSphereCast, when I have no colliders on any object. (pic 1)
The test environment is basically the Empty Template with few basic transforms sitting on the ground. I added to the (GameViewMain.pas) Press(...)
the following:
var
RayCastResult: TRayCastResult;
begin
...
if Event.IsMouseButton(buttonLeft) then
begin
RayCastResult := Viewport1.Items.PhysicsSphereCast( Camera1.Position, 0.1, Camera1.Direction);
Optionally I have added distance limit to see if the error persists, but it’s still crashing.
Adding just a single, basic TCastleBoxCollider to one of the boxes (pic 2), or to any transform, was enough to stop the game from crashing, so I guess it was happening because of zero instances of physic colliders in the world.