Hey, and thanks for reading in advance.
I got started using WorldModel today to animate a character preview within a viewport for a fighting game I’m coding, and it worked - with debilitating side-effects.
Studio crashes around 1 of every five tests when I hit the Stop button, and 100% of the time if I reset during testing. This crash is exclusively and retroactively caused by purely the existence of the WorldModel, and I conducted multiple test cases to make absolutely sure.
I created a new, blank place and inserted an identical viewportframe and worldmodel, then used the server to create a clone of the character and place it into ReplicatedStorage for the client to make a copy of for the viewportframe. No issues occurred during testing here, no matter what I did during testing. So I went back to the main game and started removing various elements to isolate the issue.
-
I weld sets of class-specific armor onto the character in this fighting game, and did so on the fake viewport character as well, so I conducted a run in which no armor was welded. Crashes persisted.
-
The Viewportframe in my main game was inside a frame, whereas the viewportframe in the repro was under a ScreenGui, so I conducted a run in which these conditions were identical. Crashes persisted.
-
To save memory, I had events rigged to the humanoid and character to disconnect events and delete the viewport character in the event of respawn/death, so I conducted a run in which these events were commented out. Crashes persisted.
-
I outright disabled the script for the main menu containing the viewportframe. No other script interacts with the main menu GUI in any fashion. Crashes persisted.
-
I placed all pertinent UI in ServerStorage, then took the UI from the repro and used that during a run instead. Crashes persisted.
-
I conducted a run in which the client script in the repro UI was deleted. Crashes persisted.
-
I restored the original main menu GUI and deleted the WorldModel. Crashes did not persist.
I can only safely conclude from this that the crash is by absolutely no means code-related, as crashes continued even when no code was acting on the user’s interface whatsoever. Crashes only occurred so long as there was a worldmodel present within the database. The fact that this did not occur in the repro means that some arbitrary difference between the repro and the main game is causing this to happen, and if it could literally be anything at all, I can’t accurately guess what’s causing worldmodels to crash my main game.
Has this happened to anyone before? Are there any ideas? The introduction of the WorldModel object happened earlier this month so I expected a bit of rough sailing, but the posts I’ve searched have literally no response from Staff regarding consistent/constant crashing.