Character invisible on client

In my game, completely randomly it seems, the character is invisible when they spawn…

Some of the parts have a Position of Vector3.new(nan, nan, nan) and a Velocity of Vector3.new(nan, nan, nan).
image

However on the server, the character is completely visible…

The client makes no modifications to the character, at all.
The only thing that I can think of right now is my custom spawning functionality.

--< Module >--
local Character = {}

function Character:OnPlayerAdded(player)
	player:LoadCharacter()
end

function Character:OnCharacterAdded(player, character)
	local function OnDied()
		wait(5)
		
		if player.Parent ~= nil then
			player:LoadCharacter()
		end
	end
	
	character.Humanoid.Died:Connect(OnDied)
end

return Character

I have had this issue for a while now, but decided I can’t take it anymore… If anyone can help, that would be amazing!

It almost seems as if the MeshParts are failing to load client-sided.

If you open up the output window, do you see anything in regards to some assets failing to load?

Also, does this happen in real game servers or just Studio tests?

1 Like

This does happen in real game servers and studio. There are no asset loading errors.

1 Like

You could possibly try creating a bug report post, assuming there’s no logical reason that’s causing this to happen. It seems bizarre. :confused:

1 Like

Yeah, to verify here is an invisible player next to a regular model.

image

So the meshes are loading.

EDIT: I’m not a regular, just a member, so I would rather wait to see if their is a solution before I go through the trouble of making a bug report.

2 Likes

Issue is still happening even without the custom spawning logic, so that isn’t the issue.

The only problem I can think about are just Motor6ds…, but I find this really weird and interesting.

I found the code that is causing this.

The client makes no modifications to the character, at all.

This was false, I am setting Motor6D transforms for body tracking… (I totally forgot)

I’ve narrowed it down to a NAN vector, I just got to figure out why it is nan…

I should be good from here, thanks for the input!

No problem, when I looked on this 30 minutes ago, I had also no idea at all.

I’ve traced it down to this piece of code…

Camera.CFrame.Position

which for whatever is a nan vector the first time it is called in a heartbeat loop

Well, I have no idea why the vector has nan values but the simple solution was to just ignore it if it did have nan values. So this was the solution I guess. Thanks everyone.