::Heys guys
so ive added dah to the player working well.
the thing im stuck with is animating the dash
ill post my new playerAnimator.cs so you can see
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerAnimator : MonoBehaviour
{
//References
Animator am;
PlayerMovement pm;
public bool isDashing;
SpriteRenderer sr;
void Start()
{
am = GetComponent<Animator>();
pm = GetComponent<PlayerMovement>();
sr = GetComponent<SpriteRenderer>();
}
void Update()
{
if (pm.moveDir.x != 0 || pm.moveDir.y != 0)
{
am.SetBool("Move", true);
am.SetBool("isDashing", false);
SpriteDirectionChecker();
}
else
{
am.SetBool("Move", false);
}
if (isDashing)
{
am.SetBool("isDashing", true);
am.SetBool("Move", false);
}
}
void SpriteDirectionChecker()
{
if (pm.lastHorizontalVector < 0)
{
sr.flipX = true;
}
else
{
sr.flipX = false;
}
}
}
not sure if ive done it right but looks right but now working, wont change in the animator
https://drive.google.com/file/d/1L4yCyyG0_W_6n_R2BCAww74rhHQIJpHH/view?usp=sharing
happy to also show my dash code if anyone wants it