WorldModel crashing studio simply by existing

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. I placed all pertinent UI in ServerStorage, then took the UI from the repro and used that during a run instead. Crashes persisted.

  6. I conducted a run in which the client script in the repro UI was deleted. Crashes persisted.

  7. 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.

2 Likes

I cannot find a solution to this. There are multiple things you can do though:

  • Give us the .rblx file for analyzing it
  • Share us the script which manages the world model

This might also just be an engine bug, or just might be a bad machine. How’s your computer? It is very old to handle this?

It’s around a 2200$ tower I built a few years ago - by no means incapable of doing what I’m doing right now. If it were my machine, I’d be crashing in the repro file I have, too. It’s something else.

Here’s the snippet of the main menu script that handles the viewport character:

do local fake = RS.FakeCharacters:WaitForChild(Player.Name, 5)
	if fake then
		local fakeCam = Instance.new("Camera")
		
		local hrp = fake:WaitForChild("HumanoidRootPart")
		local armor = fake:WaitForChild("Armor")
		
		fakeCam.CFrame = CFrame.new(hrp.Position + hrp.CFrame.LookVector * 5, hrp.Position)
		fakeCam.Parent = UI.Class.Viewer
		
		fakeChar = fake:Clone()
		fakeChar.Parent = UI.Class.Viewer.WorldModel
		
		Humanoid.AnimationPlayed:Connect(function(track)
			fakeChar.Humanoid:LoadAnimation(track.Animation):Play(nil, nil, track.Speed)
		end)
		
		for _,track in pairs(Humanoid:GetPlayingAnimationTracks()) do
			fakeChar.Humanoid:LoadAnimation(track.Animation):Play(nil, nil, track.Speed)
		end
		
		UI.Class.Viewer.CurrentCamera = fakeCam
	end
end
1 Like

Update: Just for kicks, I decided to place the mainmenu (with the worldmodel still in it) in ServerStorage, with no other UI in the StarterGui. Ran just fine, no crash on reset or disconnect.

Then I did this:

…And it crashed when I reset.

What is this new feature? I’m literally laughing now.

1 Like

Update 2: I had turned off CharacterAutoLoads for delayed respawns during specific matches, and had the server simply call LoadCharacter for the player after a delay. Disabling this and allowing ROBLOX to respawn the character naturally fixed the issue.

What’s going on with that??

2 Likes