I am trying to basically create a power meter. When you hold down the F key, a for loop runs and adds +25 to the counter which is then equal to my arrow power. It locks up when I run it though, where did I go wrong? Should I possibly be using a while loop maybe?
void Update ()
{
if(Input.GetButton("Fire Weapon"))
{
//Position to launch the arrow from:
launchPosition = cameraHeadTransform.TransformPoint(0,0, 0.0f);
//set the arrow speed
for(float cnt = 50; cnt <= maxArrowPower; cnt += 25)
{
cnt = transferArrowSpeed;
}
//create the arrow
Instantiate(arrow, launchPosition, Quaternion.Euler(cameraHeadTransform.eulerAngles.x,
myTransform.eulerAngles.y, 0));
}
}