OverlapCapsuleCommand - Cannot create a capsule from provided input!

I refactored my heavily tested well used method making use of Physics.OverlapCapsuleNonAlloc() to become asynchronous, replacing it with OverlapCapsuleCommand.ScheduleBatch(). All seemed well until stress testing were at some point during runtime I get multiple console warnings: “Cannot create a capsule from provided input!”. No other information to go off in the console, just that single warning line repeated 999+ times.

I have not come across this warning before and seems reasonable to conclude its to do with OverlapCapsuleCommand.ScheduleBatch(). This is a message I have never seen before with Physics.OverlapCapsuleNonAlloc(). I tried searching for the warning, but there are no results.

1 Like

As an update, to close this off. The problem in my case was a capsule radius was set to 0. That didn’t bother Physics.OverlapCapsuleNonAlloc(), but did bother OverlapCapsuleCommand.ScheduleBatch().

Additional side note: If you are viewing the scene during play mode, you need to keep the gameplay window visible for the scheduled batch command to finish its job (otherwise it just doe not complete).

Because I had the player window in a tab and hidden when I switched to scene view, this caused much confusion until I realised it was the cause. I opened the player in its own standalone window when I need to be looking at the scene to allow the job to finish. As of Unity 2022.3.49f1.