private void OnTriggerEnter(Collider other) { RagdollScript ragdoll = other.GetComponent <RagdollScript>(); if (!ragdoll) { return; } ragdoll.EnableRagdoll(transform.position, GetComponent <Rigidbody>()?.velocity.magnitude); }
private void OnTriggerEnter(Collider other) { RagdollScript ragdoll = other.GetComponent <RagdollScript>(); if (!ragdoll) { return; } ragdoll.EnableRagdoll(); rbody.isKinematic = false; rbody.AddForce(Vector3.up * SpringForce, ForceMode.VelocityChange); }
public void Die() { ArchievementsManager.Instance.UpdateAchievement("murder", 1); if (dropItem) { GameManager.Instance.inventory.SpawnItems(dropItem, transform.position, quantityToDrop); } if (m_RagdollScript) { m_RagdollScript.EnableRagdoll(); } ChangeKarma(karmaOnKill); ExitCombat(); StartCoroutine(SetActive(gameObject, false, secondsToDisappear)); }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { ragdoll = animator.GetComponentInParent <RagdollScript>(); ragdoll.EnableRagdoll(50.0f); }