From ce48ac64b8f7eb365476461ff2b11cdac92f5c3c Mon Sep 17 00:00:00 2001 From: Jakob Feldmann Date: Thu, 9 May 2024 15:19:01 +0200 Subject: [PATCH] feat: allow F3D projectiles to register a hit on hit feedback targets --- .../Sci-Fi Effects/Code/F3DProjectile.cs | 42 +-- .../Prefabs/seeker_bolt_flare_example.prefab | 250 +++++++++++++++--- .../Scripts/HitFeedbackTestObjectBehavior.cs | 7 +- 3 files changed, 244 insertions(+), 55 deletions(-) diff --git a/Assets/FORGE3D/Sci-Fi Effects/Code/F3DProjectile.cs b/Assets/FORGE3D/Sci-Fi Effects/Code/F3DProjectile.cs index 8aa5b0c..28a73f9 100644 --- a/Assets/FORGE3D/Sci-Fi Effects/Code/F3DProjectile.cs +++ b/Assets/FORGE3D/Sci-Fi Effects/Code/F3DProjectile.cs @@ -13,12 +13,12 @@ namespace FORGE3D public float RaycastAdvance = 2f; // Raycast advance multiplier public bool DelayDespawn = false; // Projectile despawn flag public ParticleSystem[] delayedParticles; // Array of delayed particles - ParticleSystem[] particles; // Array of projectile particles - new Transform transform; // Cached transform - RaycastHit hitPoint; // Raycast structure - bool isHit = false; // Projectile hit flag - bool isFXSpawned = false; // Hit FX prefab spawned flag - float timer = 0f; // Projectile timer + ParticleSystem[] particles; // Array of projectile particles + new Transform transform; // Cached transform + RaycastHit hitPoint; // Raycast structure + bool isHit = false; // Projectile hit flag + bool isFXSpawned = false; // Hit FX prefab spawned flag + float timer = 0f; // Projectile timer float fxOffset; // Offset of fxImpact void Awake() @@ -36,15 +36,16 @@ namespace FORGE3D isFXSpawned = false; timer = 0f; hitPoint = new RaycastHit(); - } - // OnDespawned called by pool manager - public void OnDespawned() - { - } + } - // Stop attached particle systems emission and allow them to fade out before despawning - void Delay() + // OnDespawned called by pool manager + public void OnDespawned() + { + } + + // Stop attached particle systems emission and allow them to fade out before despawning + void Delay() { if (particles.Length > 0 && delayedParticles.Length > 0) { @@ -138,11 +139,16 @@ namespace FORGE3D { isHit = true; - // Invoke delay routine if required - if (DelayDespawn) - { - // Reset projectile timer and let particles systems stop emitting and fade out correctly - timer = 0f; + if (hitPoint.collider.gameObject.TryGetComponent(out HitFeedbackTestObjectBehavior obj)) + { + obj.Hit(); + } + + // Invoke delay routine if required + if (DelayDespawn) + { + // Reset projectile timer and let particles systems stop emitting and fade out correctly + timer = 0f; Delay(); } } diff --git a/Assets/FORGE3D/Sci-Fi Effects/Examples/Prefabs/seeker_bolt_flare_example.prefab b/Assets/FORGE3D/Sci-Fi Effects/Examples/Prefabs/seeker_bolt_flare_example.prefab index bd4ebc8..afd0380 100644 --- a/Assets/FORGE3D/Sci-Fi Effects/Examples/Prefabs/seeker_bolt_flare_example.prefab +++ b/Assets/FORGE3D/Sci-Fi Effects/Examples/Prefabs/seeker_bolt_flare_example.prefab @@ -26,13 +26,14 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 100000} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 2.4, y: 2.4, z: 2.4} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 400004} m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!198 &19800000 ParticleSystem: @@ -41,19 +42,19 @@ ParticleSystem: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 100000} - serializedVersion: 6 + serializedVersion: 8 lengthInSec: 1 simulationSpeed: 1 stopAction: 0 cullingMode: 1 ringBufferMode: 0 ringBufferLoopRange: {x: 0, y: 1} + emitterVelocityMode: 0 looping: 1 prewarm: 0 playOnAwake: 1 useUnscaledTime: 0 autoRandomSeed: 1 - useRigidbodyForVelocity: 1 startDelay: serializedVersion: 2 minMaxState: 0 @@ -252,6 +253,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 minGradient: @@ -281,6 +283,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 startSize: @@ -566,7 +569,9 @@ ParticleSystem: m_PostInfinity: 2 m_RotationOrder: 4 randomizeRotationDirection: 0 + gravitySource: 0 maxNumParticles: 1000 + customEmitterVelocity: {x: 0, y: 0, z: 0} size3D: 0 rotation3D: 0 gravityModifier: @@ -1667,6 +1672,7 @@ ParticleSystem: atime6: 53585 atime7: 65535 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 8 minGradient: @@ -1696,6 +1702,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 4 UVModule: @@ -2464,6 +2471,62 @@ ParticleSystem: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 + LifetimeByEmitterSpeedModule: + enabled: 0 + m_Curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: -0.8 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0.2 + inSlope: -0.8 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Range: {x: 0, y: 1} ForceModule: enabled: 0 x: @@ -3806,6 +3869,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 minGradient: @@ -3835,24 +3899,26 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 range: {x: 0, y: 2.4} CollisionModule: enabled: 0 - serializedVersion: 3 + serializedVersion: 4 type: 0 collisionMode: 0 colliderForce: 0 multiplyColliderForceByParticleSize: 0 multiplyColliderForceByParticleSpeed: 0 multiplyColliderForceByCollisionAngle: 1 - plane0: {fileID: 0} - plane1: {fileID: 0} - plane2: {fileID: 0} - plane3: {fileID: 0} - plane4: {fileID: 0} - plane5: {fileID: 0} + m_Planes: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} m_Dampen: serializedVersion: 2 minMaxState: 0 @@ -4026,17 +4092,20 @@ ParticleSystem: interiorCollisions: 0 TriggerModule: enabled: 0 - collisionShape0: {fileID: 0} - collisionShape1: {fileID: 0} - collisionShape2: {fileID: 0} - collisionShape3: {fileID: 0} - collisionShape4: {fileID: 0} - collisionShape5: {fileID: 0} + serializedVersion: 2 inside: 1 outside: 0 enter: 0 exit: 0 + colliderQueryMode: 0 radiusScale: 1 + primitives: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} SubModule: serializedVersion: 2 enabled: 0 @@ -4220,6 +4289,7 @@ ParticleSystem: m_RotationOrder: 4 minVertexDistance: 0.2 textureMode: 0 + textureScale: {x: 1, y: 1} ribbonCount: 1 shadowBias: 0.5 worldSpace: 0 @@ -4262,6 +4332,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 minGradient: @@ -4291,6 +4362,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 widthOverTrail: @@ -4378,6 +4450,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 minGradient: @@ -4407,6 +4480,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 CustomDataModule: @@ -4445,6 +4519,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 minGradient: @@ -4474,6 +4549,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 colorLabel0: Color @@ -4727,6 +4803,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 minGradient: @@ -4756,6 +4833,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 colorLabel1: Color @@ -4987,10 +5065,12 @@ ParticleSystemRenderer: m_CastShadows: 0 m_ReceiveShadows: 0 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_RayTracingMode: 0 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -5017,6 +5097,7 @@ ParticleSystemRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_RenderMode: 0 + m_MeshDistribution: 0 m_SortMode: 0 m_MinParticleSize: 0 m_MaxParticleSize: 50 @@ -5029,15 +5110,23 @@ ParticleSystemRenderer: m_RenderAlignment: 0 m_Pivot: {x: 0, y: 0, z: 0} m_Flip: {x: 0, y: 0, z: 0} - m_UseCustomVertexStreams: 0 m_EnableGPUInstancing: 0 m_ApplyActiveColorSpace: 0 m_AllowRoll: 1 + m_FreeformStretching: 0 + m_RotateWithStretchDirection: 1 + m_UseCustomVertexStreams: 0 m_VertexStreams: 0001030405 + m_UseCustomTrailVertexStreams: 0 + m_TrailVertexStreams: 00010304 m_Mesh: {fileID: 0} m_Mesh1: {fileID: 0} m_Mesh2: {fileID: 0} m_Mesh3: {fileID: 0} + m_MeshWeighting: 1 + m_MeshWeighting1: 1 + m_MeshWeighting2: 1 + m_MeshWeighting3: 1 m_MaskInteraction: 0 --- !u!114 &11400000 MonoBehaviour: @@ -5054,10 +5143,10 @@ MonoBehaviour: fxType: 4 layerMask: serializedVersion: 2 - m_Bits: 4294967295 + m_Bits: 9 lifeTime: 5 despawnDelay: 1 - velocity: 200 + velocity: 75 RaycastAdvance: 2 DelayDespawn: 1 delayedParticles: @@ -5087,12 +5176,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 100004} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 1, z: 0, w: -0.00000004371139} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 400000} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!198 &19800004 ParticleSystem: @@ -5101,19 +5191,19 @@ ParticleSystem: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 100004} - serializedVersion: 6 + serializedVersion: 8 lengthInSec: 1 simulationSpeed: 1 stopAction: 0 cullingMode: 3 ringBufferMode: 0 ringBufferLoopRange: {x: 0, y: 1} + emitterVelocityMode: 1 looping: 1 prewarm: 0 playOnAwake: 1 useUnscaledTime: 0 autoRandomSeed: 1 - useRigidbodyForVelocity: 1 startDelay: serializedVersion: 2 minMaxState: 0 @@ -5276,6 +5366,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 minGradient: @@ -5305,6 +5396,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 startSize: @@ -5590,7 +5682,9 @@ ParticleSystem: m_PostInfinity: 2 m_RotationOrder: 4 randomizeRotationDirection: 0 + gravitySource: 0 maxNumParticles: 1000 + customEmitterVelocity: {x: 0, y: 0, z: 0} size3D: 0 rotation3D: 0 gravityModifier: @@ -6300,6 +6394,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 3 minGradient: @@ -6329,6 +6424,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 3 UVModule: @@ -7097,6 +7193,62 @@ ParticleSystem: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 + LifetimeByEmitterSpeedModule: + enabled: 0 + m_Curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: -0.8 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0.2 + inSlope: -0.8 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Range: {x: 0, y: 1} ForceModule: enabled: 1 x: @@ -8439,6 +8591,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 minGradient: @@ -8468,24 +8621,26 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 range: {x: 0, y: 1.2} CollisionModule: enabled: 0 - serializedVersion: 3 + serializedVersion: 4 type: 1 collisionMode: 0 colliderForce: 0 multiplyColliderForceByParticleSize: 0 multiplyColliderForceByParticleSpeed: 0 multiplyColliderForceByCollisionAngle: 1 - plane0: {fileID: 0} - plane1: {fileID: 0} - plane2: {fileID: 0} - plane3: {fileID: 0} - plane4: {fileID: 0} - plane5: {fileID: 0} + m_Planes: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} m_Dampen: serializedVersion: 2 minMaxState: 0 @@ -8659,17 +8814,20 @@ ParticleSystem: interiorCollisions: 0 TriggerModule: enabled: 0 - collisionShape0: {fileID: 0} - collisionShape1: {fileID: 0} - collisionShape2: {fileID: 0} - collisionShape3: {fileID: 0} - collisionShape4: {fileID: 0} - collisionShape5: {fileID: 0} + serializedVersion: 2 inside: 1 outside: 0 enter: 0 exit: 0 + colliderQueryMode: 0 radiusScale: 1 + primitives: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} SubModule: serializedVersion: 2 enabled: 0 @@ -8853,6 +9011,7 @@ ParticleSystem: m_RotationOrder: 4 minVertexDistance: 0.2 textureMode: 0 + textureScale: {x: 1, y: 1} ribbonCount: 1 shadowBias: 0.5 worldSpace: 0 @@ -8895,6 +9054,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 minGradient: @@ -8924,6 +9084,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 widthOverTrail: @@ -9011,6 +9172,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 minGradient: @@ -9040,6 +9202,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 CustomDataModule: @@ -9078,6 +9241,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 minGradient: @@ -9107,6 +9271,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 colorLabel0: Color @@ -9360,6 +9525,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 minGradient: @@ -9389,6 +9555,7 @@ ParticleSystem: atime6: 0 atime7: 0 m_Mode: 0 + m_ColorSpace: -1 m_NumColorKeys: 2 m_NumAlphaKeys: 2 colorLabel1: Color @@ -9620,10 +9787,12 @@ ParticleSystemRenderer: m_CastShadows: 0 m_ReceiveShadows: 0 m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 m_MotionVectors: 1 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_RayTracingMode: 0 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -9650,6 +9819,7 @@ ParticleSystemRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_RenderMode: 0 + m_MeshDistribution: 0 m_SortMode: 1 m_MinParticleSize: 0 m_MaxParticleSize: 50 @@ -9662,13 +9832,21 @@ ParticleSystemRenderer: m_RenderAlignment: 0 m_Pivot: {x: 0, y: 0, z: 0} m_Flip: {x: 0, y: 0, z: 0} - m_UseCustomVertexStreams: 0 m_EnableGPUInstancing: 0 m_ApplyActiveColorSpace: 0 m_AllowRoll: 1 + m_FreeformStretching: 0 + m_RotateWithStretchDirection: 1 + m_UseCustomVertexStreams: 0 m_VertexStreams: 0001030405 + m_UseCustomTrailVertexStreams: 0 + m_TrailVertexStreams: 00010304 m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} m_Mesh1: {fileID: 0} m_Mesh2: {fileID: 0} m_Mesh3: {fileID: 0} + m_MeshWeighting: 1 + m_MeshWeighting1: 1 + m_MeshWeighting2: 1 + m_MeshWeighting3: 1 m_MaskInteraction: 0 diff --git a/Assets/Scripts/HitFeedbackTestObjectBehavior.cs b/Assets/Scripts/HitFeedbackTestObjectBehavior.cs index 2460541..2541220 100644 --- a/Assets/Scripts/HitFeedbackTestObjectBehavior.cs +++ b/Assets/Scripts/HitFeedbackTestObjectBehavior.cs @@ -23,7 +23,7 @@ public class HitFeedbackTestObjectBehavior : MonoBehaviour [SerializeField] private float normalDrag = 0.1f; [SerializeField] private float maximumDrag = 0.3f; [SerializeField] private float torqueDrag = 0.2f; - [SerializeField] private float tackleStunTime = 0.6f; + [SerializeField] private float tackleStunTime = 2f; // The time in Seconds the player is allowed to boost for private Rigidbody body; private Vector3 currentGravity = new Vector3(); @@ -165,6 +165,11 @@ public class HitFeedbackTestObjectBehavior : MonoBehaviour float colliderMass = collider.attachedRigidbody.mass; body.AddForce(colliderVelocity.magnitude * tackleDirection * (colliderMass / body.mass), ForceMode.Acceleration); + Hit(); + } + + public void Hit() + { UpdateTackleResponse(true); hitSound.PlayAudio(false); Destruction();