Ragdoll glitch after enemy die

bluebird

Member
Hi @Justin

After player kills the AI enemy, ragdoll spawns.. But spawned ragdoll is misbehaving..
Check out this video:


First I thought that behavior tree may executing even after character die.. bu tlater I found that on death event, you already disabled behavior tree.

private void OnDeath(Vector3 position, Vector3 force, GameObject attacker)
{
m_BehaviorTreeEnabled = BehaviorManager.instance.IsBehaviorEnabled(m_BehaviorTree);
if (m_BehaviorTreeEnabled) {
m_BehaviorTree.DisableBehavior();
}
}


You can also see an error after enemy character die.

Looking forward to the fix.

Thank you!
 

Justin

Administrator
Staff member
That's likely a problem with the joints that you have setup for each ragdoll collider. I'm definitely not an expert in how those should be configured but in the past I have seen some suggestions on the Unity forum.
 

bluebird

Member
@Justin Did you notice this error in console after enemy character die?

"SetDestination" can only be called on an active agent that has been placed on a NavMesh.
UnityEngine.AI.NavMeshAgent:SetDestination(Vector3)
Opsive.UltimateCharacterController.Character.Abilities.AI.NavMeshAgentMovement:OnGrounded(Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/AI/NavMeshAgentMovement.cs:153)
Opsive.UltimateCharacterController.Events.InvokableAction`1:Invoke(Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Events/InvokableAction.cs:87)
Opsive.UltimateCharacterController.Events.EventHandler:ExecuteEvent(Object, String, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Events/EventHandler.cs:389)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:UpdateGroundState(Boolean, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:831)
Opsive.UltimateCharacterController.Character.CharacterLocomotion:DeflectVerticalCollisions() (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:1130)
Opsive.UltimateCharacterController.Character.CharacterLocomotion:UpdatePosition() (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:780)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:UpdatePosition() (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:950)
Opsive.UltimateCharacterController.Character.CharacterLocomotion:UpdatePositionAndRotation() (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:548)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:UpdatePositionAndRotation() (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:813)
Opsive.UltimateCharacterController.Character.CharacterLocomotion:UpdatePositionAndRotation(Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:526)
Opsive.UltimateCharacterController.Character.CharacterLocomotion:Move(Single, Single, Single) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:492)
Opsive.UltimateCharacterController.Game.KinematicCharacter:FixedMove(Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:202)
Opsive.UltimateCharacterController.Game.KinematicObjectManager:FixedUpdate() (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:751)
 

Justin

Administrator
Staff member
Are you running an older version of the controller? That error should have been fixed. If you are running the latest and can tell me how to reproduce it within a fresh project of the integration sample I can take a look.
 

bluebird

Member
Hey @Justin

I tried re-producing the bug while setting up everything in blank project.. but I didn't get any error after player kills enemy!
So I simply re-created new enemy character from character manager in main project.. and deleted old one.

SOLVED šŸ˜Œ
 
Top