Bug in version 1.75

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

Thu Jul 23, 2020 10:45 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: 50
Joined: Tue Sep 11, 2018 3:04 am

Thu Jul 23, 2020 10:53 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: 1541
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Fri Jul 24, 2020 5:16 am

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

Fri Jul 24, 2020 5:28 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: 1541
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Fri Jul 24, 2020 5:32 am

Please show me the line 105 of your bl_BodyPartManager.cs

*Support continues on Discord*
User avatar
Leonid_RU
Contributor
Contributor
Posts: 50
Joined: Tue Sep 11, 2018 3:04 am

Fri Jul 24, 2020 6:07 am

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

Code: Select all

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