A constant explosion force

Hello, I need this code to add the force when I am holding my “fire1” button. Right now it only adds the force once.

var projectile : Rigidbody;
var speed = 20;
var explosionTime = 1.0;
var explosionRadius = 5.0;
var explosionPower = 2000.0;

function Update ()
{
	if(Input.GetButtonDown ("Fire1"))
	{

		var colliders : Collider[] = Physics.OverlapSphere (transform.position, explosionRadius);
	
	for(var hit in colliders)
	{
		if(hit.rigidbody)
		{
			hit.rigidbody.AddExplosionForce(explosionPower, transform.position, explosionRadius);	
		}
	}
	}

}

Any help or hints would be great :smile:

if ( Input.GetButton

instead of

if ( Input.GetButtonDown

will return true while the button is held instead of only returning true once when the button is pressed.

Thanks, thats just what I needed!