Bug in version 1.75

Report bugs of MFPS 2.0 here
Post Reply
User avatar
Leonid_RU
Contributor
Contributor
Posts: 56
Joined: Tue Sep 11, 2018 3:04 am

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
User avatar
Leonid_RU
Contributor
Contributor
Posts: 56
Joined: Tue Sep 11, 2018 3:04 am

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?
User avatar
Lovatto
Admin
Admin
Posts: 1755
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

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
How to find your Invoice Number: Here
How to find your Order Number: Here
User avatar
Leonid_RU
Contributor
Contributor
Posts: 56
Joined: Tue Sep 11, 2018 3:04 am

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)
User avatar
Lovatto
Admin
Admin
Posts: 1755
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Please show me the line 105 of your bl_BodyPartManager.cs

*Support continues on Discord*
How to find your Invoice Number: Here
How to find your Order Number: Here
User avatar
Leonid_RU
Contributor
Contributor
Posts: 56
Joined: Tue Sep 11, 2018 3:04 am

The string fixes this problem. Lovatto, thank you for your help!

Code: Select all

if (transform == null || transform.parent != null) return;
User avatar
aido_92
New Member
New Member
Posts: 3
Joined: Mon Jun 28, 2021 5:51 am

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)
User avatar
Lovatto
Admin
Admin
Posts: 1755
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Try this:

in bl_BodyPartManager.cs add this code:

Code: Select all

void OnDisable()
{
bl_EventHandler.onLocalPlayerSpawn -= OnLocalSpawn;
}
How to find your Invoice Number: Here
How to find your Order Number: Here
Post Reply