i need to make skill attack moves for my game but i dont know what i need to do to make character animation + effects and i dont know what should i write in script
i need to make character skill example game: genshin impact so i need something like character when pushed skill button he uses animation and effects to damage enemy after animation ends cooldown 15 seconds
I don’t know that much about animation but I can help with everything else.
For effects, you can just use unity’s particle system. Right click, Effects, Particle system. Make it a prefab (a saved object) and have it be instantiated by the attack on creation Everything having to do with it should be self explanatory and you should get used to it in time.
For the scripts, have the player Instantiate a gameobject prefab of which is the attack on button press and set the damage of the attack to something dictated by the player, then use a coroutine to set a delay before the player can use it again kinda like this:
// object to create on attack
public GameObject a;
// delay on attack, set to 15 by default
public float D = 15;
// special attack damage, or the damage of the attack
public int SAD;
bool F = true;
void Update()
{
if (F && Input.GetButtonDown("Skill"))
{
NameOfScriptOnObject A = Instantiate(p, transform).GetComponent<NameOfScriptOnObject>();
// make sure D (damage) is public, so not only can it be changed, but enemies hit by it can tell how much damage they should be taking
A.D = SAD;
StartCoroutine(Rebound(D));
}
}
// This is a coroutine made to prevent the attack from triggering again immediately after firing, and yes, I call cooldown times "rebound times"
IEnumerator Rebound(float S)
{
F = false;
yield return new WaitForSeconds(S);
F = true;
}
If you want multiple of these, simply change every variable into an array. Hope this helped!