You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/Source/Scripts/EnableHitVFX.cs

21 lines
400 B
C#

2 months ago
using D2D;
using DG.Tweening;
using UnityEngine;
public class EnableHitVFX : MonoBehaviour
{
[SerializeField] private ParticleSystem VFX;
private Tween tween;
private const float punchScale = 0.005f;
private void OnTriggerEnter(Collider collision)
{
VFX?.Play();
tween.KillTo0();
tween = transform.DOPunchScale(Vector3.one * punchScale, .2f);
}
}