As of 0.625, using a very specific setup with the ControllerManager can rarely cause a crash instead of throwing an error. This has been very difficult to replicate and explain but it managed to occur a few times in production.
In Studio it closes the app immediately, but in a live game it brings up the “unexpected error” message.
The crash seems to occur somewhat more consistently when Workspace.SignalBehavior is set to Immediate rather than Deferred. Interestingly if it’s set to Deferred I could only replicate it if the “Updated Roblox Controls” beta feature was enabled, however the place file provided uses Immediate since it seems to crash more consistently.
A flaw in the code provided where the ControllerManager’s ActiveController is currently set to a destroyed AirController and attempted to be set to nil, while the ControllerManager itself is later destroyed may be a cause of the issue.
It’s possible that it’s affected by higher framerates or timing but it could also be my code itself causing a framerate dependency since the original code is designed to step a character each frame. Either way this has been an extremely frustrating bug to figure out due to its inconsistency.
Repro
- Download the place file and open it
- Hit Play Solo
- Reset the character as soon as possible (esc-r-enter)
You may have to repeat step 3 a few times since respawning isn’t implemented in the place file.
Place files
Player: ctmanager crash test 2 - Roblox
Studio: minimalCrashTest2.rbxl (50.3 KB)
Demonstrations
Player:
Studio:
Expected behavior
A regular error is thrown by attempting to set the ActiveController of a destroyed ControllerManager.
A private message is associated with this bug report