Page 1 of 1

Bug in version 1.75

Posted: Thu Jul 23, 2020 10:45 am
by Leonid_RU
There is a very strange error in MFPS version 1.75. After the played round (per round = false), we go to the lobby and then start a new game again, and immediately there is an error related to bl_BodyPartManager.

Code: Select all

MissingReferenceException: The object of type 'bl_BodyPartManager' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
bl_BodyPartManager.OnLocalSpawn () (at Assets/MFPS/Scripts/Player/Body/bl_BodyPartManager.cs:103)
bl_EventHandler.PlayerLocalSpawnEvent () (at Assets/MFPS/Scripts/Internal/Events/bl_EventHandler.cs:171)
bl_GameManager.SpawnPlayerModel (Team playerTeam) (at Assets/MFPS/Scripts/Network/Room/bl_GameManager.cs:297)
bl_GameManager.SpawnPlayer (Team t_team) (at Assets/MFPS/Scripts/Network/Room/bl_GameManager.cs:162)
bl_GameManager.SpawnPlayerWithCurrentTeam () (at Assets/MFPS/Scripts/Network/Room/bl_GameManager.cs:315)
The player himself appears, but without a full UI, that is, the Game Manager script with void Spawn Player Model was not completely finished and those that are after it. Please check that no Addons are installed on the build. MAPS has been updated from version 1.7 to 1.75. There is also a constant warning:

Code: Select all

There are 2 audio listeners in the scene. Please ensure there is always exactly one audio listener in the scene.
Image

Re: Bug in version 1.75

Posted: Thu Jul 23, 2020 10:53 am
by Leonid_RU
The error appears only when the player dies at the end of the round, i.e. when killcam is active and the results are being summed up. I think this is related to bl_EventHandler.on Local Player Spawn.
Tell me what is the solution?

Re: Bug in version 1.75

Posted: Fri Jul 24, 2020 5:16 am
by Lovatto
Try the following:

Add this line:

Code: Select all

 if (transform.parent != null) return;
at the top pf the function OnLocalSpawn() in bl_BodyPartManager.cs
Image

Re: Bug in version 1.75

Posted: Fri Jul 24, 2020 5:28 am
by Leonid_RU
Hello! It didn't help, the error still occurs.
The error leads to a string

Code: Select all

if (transform.parent != null) return;

Code: Select all

MissingReferenceException: The object of type 'bl_BodyPartManager' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
bl_BodyPartManager.OnLocalSpawn () (at Assets/MFPS/Scripts/Player/Body/bl_BodyPartManager.cs:105)
bl_EventHandler.PlayerLocalSpawnEvent () (at Assets/MFPS/Scripts/Internal/Events/bl_EventHandler.cs:168)
bl_GameManager.SpawnSelectedPlayer (MFPS.PlayerSelector.bl_PlayerSelectorInfo info, Team playerTeam) (at Assets/MFPS/Scripts/Network/Room/bl_GameManager.cs:355)
bl_GameManager.SpawnPlayer (Team t_team) (at Assets/MFPS/Scripts/Network/Room/bl_GameManager.cs:166)
bl_GameManager.SpawnPlayerWithCurrentTeam () (at Assets/MFPS/Scripts/Network/Room/bl_GameManager.cs:253)

Re: Bug in version 1.75

Posted: Fri Jul 24, 2020 5:32 am
by Lovatto
Please show me the line 105 of your bl_BodyPartManager.cs

*Support continues on Discord*

Re: Bug in version 1.75

Posted: Fri Jul 24, 2020 6:07 am
by Leonid_RU
The string fixes this problem. Lovatto, thank you for your help!

Code: Select all

if (transform == null || transform.parent != null) return;

Re: Bug in version 1.75

Posted: Tue Jul 13, 2021 2:39 am
by aido_92
Hello!

I have version 1.8.2, the problem persists.

Prints an error in the console:

MissingReferenceException: The object of type 'bl_BodyPartManager' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
bl_BodyPartManager.OnLocalSpawn () (at Assets/MFPS/Scripts/Player/Body/bl_BodyPartManager.cs:89)
bl_EventHandler.DispatchPlayerLocalSpawnEvent () (at Assets/MFPS/Scripts/Internal/Events/bl_EventHandler.cs:197)
bl_GameManager.InstancePlayer (UnityEngine.GameObject prefab, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, Team team) (at Assets/MFPS/Scripts/Network/Room/bl_GameManager.cs:207)
bl_GameManager.SpawnPlayerModel (Team playerTeam) (at Assets/MFPS/Scripts/Network/Room/bl_GameManager.cs:179)
bl_GameManager.SpawnPlayer (Team playerTeam) (at Assets/MFPS/Scripts/Network/Room/bl_GameManager.cs:145)
bl_GameManager.SpawnPlayerWithCurrentTeam () (at Assets/MFPS/Scripts/Network/Room/bl_GameManager.cs:260)

Re: Bug in version 1.75

Posted: Fri Sep 03, 2021 7:33 am
by Lovatto
Try this:

in bl_BodyPartManager.cs add this code:

Code: Select all

void OnDisable()
{
bl_EventHandler.onLocalPlayerSpawn -= OnLocalSpawn;
}