Custom bots not ragdolling

Support for MFPS 2.0 (for verified users)
Forum rules
To request support/assistance for MFPS, you first have to verify your purchase by sending your purchase invoice number to Lovatto in a PM.
Post Reply
User avatar
docmartin
Contributor
Contributor
Posts: 12
Joined: Fri Jun 23, 2017 11:12 am
Contact:

Custom bots don't ragdoll on death? Checked components against AISoldiers and they match except BL-Shooter References is missing script in Ai Animation, and will NOT let me add anything.

NullReferenceException: Object reference not set to an instance of an object
bl_AIShooterHealth.RpcDoDamage (System.Int32 damage, System.String weaponName, UnityEngine.Vector3 direction, System.Int32 viewID, System.Boolean fromBot, System.Boolean ishead, System.Int32 hitBoxID) (at Assets/MFPS/Scripts/GamePlay/AI/bl_AIShooterHealth.cs:102)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>: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 <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
Photon.Pun.PhotonNetwork.ExecuteRpc (ExitGames.Client.Photon.Hashtable rpcData, Photon.Realtime.Player sender) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:540)
Photon.Pun.PhotonNetwork.RPC (Photon.Pun.PhotonView view, System.String methodName, Photon.Pun.RpcTarget target, Photon.Realtime.Player player, System.Boolean encrypt, System.Object[] parameters) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:1264)
Photon.Pun.PhotonNetwork.RPC (Photon.Pun.PhotonView view, System.String methodName, Photon.Pun.RpcTarget target, System.Boolean encrypt, System.Object[] parameters) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:2833)
Photon.Pun.PhotonView.RPC (System.String methodName, Photon.Pun.RpcTarget target, System.Object[] parameters) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonView.cs:800)
bl_AIShooterHealth.DoDamage (System.Int32 damage, System.String wn, UnityEngine.Vector3 direction, System.Int32 vi, System.Boolean fromBot, Team team, System.Boolean ishead, System.Int32 hitBoxID) (at Assets/MFPS/Scripts/GamePlay/AI/bl_AIShooterHealth.cs:48)
bl_AIHitBox.ReceiveDamage (DamageData damageData) (at Assets/MFPS/Scripts/GamePlay/AI/bl_AIHitBox.cs:39)
bl_Bullet.SendBotDamage (UnityEngine.RaycastHit hit) (at Assets/MFPS/Scripts/Weapon/Projectiles/bl_Bullet.cs:245)
bl_Bullet.OnHit (UnityEngine.RaycastHit hit) (at Assets/MFPS/Scripts/Weapon/Projectiles/bl_Bullet.cs:162)
bl_Bullet.Travel () (at Assets/MFPS/Scripts/Weapon/Projectiles/bl_Bullet.cs:111)
bl_Bullet.OnUpdate () (at Assets/MFPS/Scripts/Weapon/Projectiles/bl_Bullet.cs:90)
MFPS.Internal.bl_UpdateManager.Update () (at Assets/MFPS/Scripts/Internal/General/bl_UpdateManager.cs:184)
User avatar
Lovatto
Admin
Admin
Posts: 1834
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Try the following:
in TutorialBots.cs after the line 141 add these lines:

Code: Select all

 var botReferences = botPrefab.GetComponent<bl_AIShooterReferences>();
  botReferences.aiAnimation = aia;
Then replace your bot model again using the Tutorial window.
How to find your Invoice Number: Here
How to find your Order Number: Here
User avatar
commonblob
Contributor
Contributor
Posts: 18
Joined: Fri Feb 05, 2021 1:26 pm

Hey Lovatto, would be good if these little fixes you make post release could be collected somewhere so they dont get missed. I had the same problem and thankfully stumbled on this post that fixed it. But just an idea :D
Post Reply