so this is the script, it’s the basic explosion script from the Unity scripting reference.
the problem is that as soon as the game starts, blocks go flying; it completely ignores whether I’ve pressed the button down or not.
using UnityEngine;
using System.Collections;
public class Explode : MonoBehaviour
{
public float radius = 6.0F;
public float power = 10.0F;
void Update()
{
if(Input.GetKeyDown (KeyCode.E))
{
Debug.Log ("called");
Vector3 explosionPos = transform.position;
Collider[] colliders = Physics.OverlapSphere(explosionPos, radius);
foreach (Collider hit in colliders) {
if (!hit)
if (hit.rigidbody)
hit.rigidbody.AddExplosionForce(power, explosionPos, radius, 3.0F);
}
}
}
}