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)
MFPS 1.6 Create player
- Lovatto
- Admin
- Posts: 1834
- Joined: Sun Dec 07, 2014 3:18 pm
- Contact:
I have found and fixed the problem,
In AddPlayerTutorial.cs -> line 216 and 229
change:
to
in bl_BodyPartManager.cs change:
to
In AddPlayerTutorial.cs -> line 216 and 229
change:
Code: Select all
PlayerInstantiated = PrefabUtility.InstantiatePrefab(bl_GameData.Instance.Player1) as GameObject;
Code: Select all
PlayerInstantiated = PrefabUtility.InstantiatePrefab(bl_GameData.Instance.Player1.gameObject) as GameObject;
Code: Select all
if (bp == null) { bp.gameObject.AddComponent<bl_BodyPart>(); }
Code: Select all
if (bp == null) { bp = col.gameObject.AddComponent<bl_BodyPart>(); }
- BreynartStudios
- Contributor
- Posts: 5
- Joined: Sun Mar 15, 2020 9:39 am
Thanks a lot! Now is less than 5 secs to create your own player. AWESOME asset, Lovatto!!!
- BreynartStudios
- Contributor
- Posts: 5
- Joined: Sun Mar 15, 2020 9:39 am
Advice:
Similar thing occurs when creating bots following in-game's tutorial.
Find the script TutorialBots.cs and change in line 106, from this:
To this:
That will fix the bot creation
Similar thing occurs when creating bots following in-game's tutorial.
Find the script TutorialBots.cs and change in line 106, from this:
Code: Select all
GameObject botPrefab = PrefabUtility.InstantiatePrefab(bl_GameData.Instance.BotTeam1) as GameObject;
Code: Select all
GameObject botPrefab = PrefabUtility.InstantiatePrefab(bl_GameData.Instance.BotTeam1.gameObject) as GameObject;