What is the class called when you are doing a while loop.
it cant be public void. is there another way then to do a while loop if i want to make a charging attack?
You must call it in C# with StartCoroutine(CalculateCharge()), or in another coroutine with yield return new CalculateCharge()
Notice also that while loops must be written this way:
while (condition){
// code
}
In this case, condition is Input.GetButton(“buttonName”), because it must return true while the button is pressed (GetButtonDown returns true only during the update cycle).