MFPS 1.6 Create player

Report bugs of MFPS 2.0 here
Post Reply
User avatar
ridick
Contributor
Contributor
Posts: 24
Joined: Wed Jun 17, 2015 8:20 am

Thu Dec 26, 2019 2:27 am

NullReferenceException: Object reference not set to an instance of an object
bl_BodyPartManager.CreateHitBox (UnityEngine.HumanBodyBones bone) (at Assets/MFPS/Scripts/Player/Body/bl_BodyPartManager.cs:201)
bl_BodyPartManager.SetUpHitBoxes () (at Assets/MFPS/Scripts/Player/Body/bl_BodyPartManager.cs:167)
AddPlayerTutorial.SetUpModelInPrefab () (at Assets/MFPS/Scripts/Internal/Editor/MFPS/Tutorials/AddPlayerTutorial.cs:400)
AddPlayerTutorial.DrawPlayerPrefab () (at Assets/MFPS/Scripts/Internal/Editor/MFPS/Tutorials/AddPlayerTutorial.cs:257)
AddPlayerTutorial.WindowArea (System.Int32 window) (at Assets/MFPS/Scripts/Internal/Editor/MFPS/Tutorials/AddPlayerTutorial.cs:63)
MFPSEditor.TutorialWizard.OnGUI () (at <08b9a629bdaf4593a88828b77d0efa1b>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <a8ed250850854b439cedc18931a314fe>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <a8ed250850854b439cedc18931a314fe>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <a8ed250850854b439cedc18931a314fe>:0)
User avatar
Lovatto
Admin
Admin
Posts: 1132
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Sun Dec 29, 2019 2:10 pm

I have found and fixed the problem,

In AddPlayerTutorial.cs -> line 216 and 229
change:

Code: Select all

PlayerInstantiated = PrefabUtility.InstantiatePrefab(bl_GameData.Instance.Player1) as GameObject;
to

Code: Select all

PlayerInstantiated = PrefabUtility.InstantiatePrefab(bl_GameData.Instance.Player1.gameObject) as GameObject;
in bl_BodyPartManager.cs change:

Code: Select all

 if (bp == null) { bp.gameObject.AddComponent<bl_BodyPart>(); }
to

Code: Select all

 if (bp == null) { bp = col.gameObject.AddComponent<bl_BodyPart>(); }
User avatar
ridick
Contributor
Contributor
Posts: 24
Joined: Wed Jun 17, 2015 8:20 am

Mon Dec 30, 2019 12:16 am

Thanks! :)
Post Reply