So I’m working on a game and I joined it today to test it but my character was invisible. I rejoined a couple of times and it happens about 50% of the time. This only happens on the client because the server can see everything, it also only happens in game (not in studio). I added a couple print statements to find out what’s happening and it turns out that all the players parts are invisible. I’ve searched through all my scripts for the word “Transparency” and the only thing that popped up is the print statement on the client. Yesterday everything was working perfectly fine and I didn’t get this issue. It only started today and I didn’t change anything in any of the scripts. I have also tested this on mobile and it doesn’t happen on mobile which even more strange. What’s even more strange is that if I change my account to an alt on my computer then it doesn’t do it. So it seems like it’s only happening to my account on my pc. Does anyone know what’s happening?
probably a free model or a plugin virus?
Yeah but would that cause it to only happen for one account on a certain device?
Can you go test it in studio, while you’re in game can you show the screen shot of your explorer and show all the childrens in you character.
After further testing I’ve found that this only happens when I join a empty server. If I join a different player then I don’t get this issue. If I join a empty server then my character is invisible
I have no idea how but adding a wait() in my pets script somehow fixed the issue (I think). I’m not changing any of the characters properties in the script so maybe it was related to the player not fully loading in and the script tried to equip pets or something. I’m not sure exactly what the problem was but I believe it’s fixed now (still have to do a bit more testing)
To see if its being changed, put a local script into your StarterCharacterScripts and put this code into it:
local char = game.Players.LocalPlayer.Character for _, v in pairs(char:GetChildren()) do if v:IsA("BasePart") then v.Changed:Connect(function(prop) print(v.Name.. " has been changed and the property ".. prop.. " changed to "..tostring(v[prop])) end) end end
But I’m not changing it. Here is the pet script
game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart") wait(1) for _, player in pairs(game.Players:GetChildren()) do if player.Character then player.Character:WaitForChild("HumanoidRootPart") local PetLook = script.PetLook:Clone() PetLook.Parent = player.Character PetLook.CFrame = (player.Character.HumanoidRootPart.CFrame) print("Normal Pets") UpdatePets1(player) UpdatePets2(player) end player.CharacterAdded:Connect(function() player.Character:WaitForChild("HumanoidRootPart") local PetLook = script.PetLook:Clone() PetLook.Parent = player.Character print("CharacterAdded Pets") PetLook.CFrame = (player.Character.HumanoidRootPart.CFrame) UpdatePets1(player) end) end game.Players.PlayerAdded:Connect(function(player) if player.Character then player.Character:WaitForChild("HumanoidRootPart") local PetLook = script.PetLook:Clone() PetLook.Parent = player.Character PetLook.CFrame = (player.Character.HumanoidRootPart.CFrame) UpdatePets1(player) UpdatePets2(player) end player.CharacterAdded:Connect(function() player.Character:WaitForChild("HumanoidRootPart") local PetLook = script.PetLook:Clone() PetLook.Parent = player.Character PetLook.CFrame = (player.Character.HumanoidRootPart.CFrame) UpdatePets1(player) end) end) pets:GetPropertyChangedSignal("Value"):Connect(function() if pets.Value then for _, player in pairs(game.Players:GetChildren()) do UpdatePets1(player) end else for _, player in pairs(game.Players:GetChildren()) do if player.Character then for _, item in pairs(player.Character:GetChildren()) do if item:IsA("Model") then item:Destroy() end end end end end end)
That’s the only code I have. After adding the wait(1) on line 2 it fixed it for some reason.
Try disabling that script and play again. If the problem continues then there is something wrong.
A virus or something.
After disabling it it doesn’t happen anymore. I’m not sure why though. There isn’t anything to do with setting any of the characters attributes in the script
It’s definitely something with the pets.
It’s not a virus or a freemodel(potentially).
It could probably be glitching the character out, or something related.
It’s definetly not a virus. I wrote everything myself. Here is the full script. Maybe I missed something
Removed to prevent people coping my code
Yeah we figured out its not a virus. It must be a glitch in the code.
You could make it so only when the character is loaded it will do the scripts, I’m not fully sure what is causing that bug, but I think this could help somewhat. If it does not help, tell me, and look in the output for any errors.
There aren’t any errors. And how am I meant to check if the player’s character is fully loaded in? I already have multiple :WaitForChild(“HumanoidRootPart”) statements to make sure the character is loaded in.
Okay, create a copy of your game. remove all the pets in the copy, then spawn in. if that doesn’t work, slowly, remove all the scripts in the copy, until the player spawns in. If that doesn’t work, I have no clue as to how your character spawns invisible. Also check if the characters body parts transparency property = 1, if it is, than magic is being used or something because I have no clue how it would be like that. Hope this helps.
But I already know which script is causing it. It’s the pet script for some reason. And it is setting the transparency property to 1. I’m not sure what happened because it worked perfectly for about a week and today it just kept making the player transparent. I’ve found a temporary fix by just adding a wait()
You can just overwrite that by setting the transparency to 0, that is my best solution, I would probably restart the whole pet system, and ask for tons of advice on the dev forum, but it might take longer than just figuring the problem out normally.
You can also check if a character is loading in by this:
local char = game.Players.AnotherScriptStudio.CharacterAdded:Wait()