diff --git a/Assets/Scripts/Components/ProcessHitComponent.cs b/Assets/Scripts/Components/ProcessHitComponent.cs index d7c547eb..265ebbd4 100644 --- a/Assets/Scripts/Components/ProcessHitComponent.cs +++ b/Assets/Scripts/Components/ProcessHitComponent.cs @@ -15,9 +15,11 @@ public class ProcessHitComponent : MonoBehaviour if (ignored.Contains(source)) return; - Debug.Log("Got hit"); + var damage = args.damage.value; + var multiplier = args.hitMultiplier; + var finalDamage = damage * multiplier; - onTakeDamage.Invoke(args.damage.value); + onTakeDamage.Invoke((int)finalDamage); ignored.Add(args.source); } diff --git a/Assets/Scripts/Components/RagdollComponent.cs b/Assets/Scripts/Components/RagdollComponent.cs index 383f9e89..6829fb70 100644 --- a/Assets/Scripts/Components/RagdollComponent.cs +++ b/Assets/Scripts/Components/RagdollComponent.cs @@ -12,6 +12,8 @@ public class RagdollComponent : MonoBehaviour StartCoroutine(RagdollCoroutine()); } + // Needs to be coroutine, because if we modify all rigidbodies at the same time, + // unity play mode crashed in VR IEnumerator RagdollCoroutine() { var animators = GetComponentsInChildren();