Home Game Development unity – How do I do a splash harm utilizing this technique?

unity – How do I do a splash harm utilizing this technique?

0
unity – How do I do a splash harm utilizing this technique?

[ad_1]

  [SerializeField]float dashingSpeed = 25f;
[SerializeField]float dashingTime = 0.2f;
float dashingCoolDown = 1f;
bool candash = true;
bool IsDashing;
[SerializeField]float MovingSpeed = 10f;
Rigidbody rb;

 void dashing()
{
    if (Input.GetKeyDown(KeyCode.W) && candash)
    {
        StartCoroutine(Dashing());
    }
}

   IEnumerator Dashing()
    {
        candash = false;
        IsDashing = true;
        rb.velocity = rework.proper * dashingSpeed;
        rework.gameObject.tag = "dashes";
        yield return new WaitForSeconds(dashingTime);
        IsDashing = false;
        rework.gameObject.tag = "Player";
        yield return new WaitForSeconds(dashingCoolDown);
        candash = true;
    }

Hi, i used to be pondering of fixing a gameobject tag throughout the sprint however typically it did not work, like my recreation object stays beneath “Player” as an alternative of fixing typically. Which is bizarre. why?
oh i do that as a result of like as soon as it change throughout that “dashing” length, the opposite recreation object will take harm when obtained hit by that tag. So it’s going to really feel like that object take harm throughout the dashes

p.s, i welcome some other recommendations for sprint harm haha

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here