sentrygun script won't respond if no collider

Hello guys. I mixed the Sentrygun and RocketLauncher scripts of the fps tutorial. I added it on a cube to test it. But if you add a character controller to a object and set that object as a target to the sentrygun. it won't shoot at it. But if i set a cube with a boxcollider as a target, it WILL shoot at it. what should i do ? (i removed the part of "ignore physics of the character controller" but it still won't work. but when i add a cube and set that as a target. it will shoot at it. i just don't understand!?

here is the code:


var attackRange = 30.0; var shootAngleDistance = 10.0; var target : Transform; var projectile : Rigidbody; var initialSpeed = 20.0; var reloadTime = 0.5; var ammoCount = 20; private var lastShot = -10.0;

function Start () { if (target == null && GameObject.FindWithTag("Player")) target = GameObject.FindWithTag("Player").transform; }

function Update () { if (target == null) return;

if (!CanSeeTarget ())

// Rotate towards target    
var targetPoint = target.position;
var targetRotation = Quaternion.LookRotation (targetPoint - transform.position, Vector3.up);
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * 2.0);

// If we are almost rotated towards target - fire one clip of ammo
var forward = transform.TransformDirection(Vector3.forward);
var targetDir = target.position - transform.position;
if (Vector3.Angle(forward, targetDir) < shootAngleDistance)


function CanSeeTarget () : boolean { if (Vector3.Distance(transform.position, target.position) > attackRange) return false;

var hit : RaycastHit;
if (Physics.Linecast (transform.position, target.position, hit))
    return hit.transform == target;

return false;


function Fire () { //Did the time exceed the reload time? if (Time.time > reloadTime + lastShot && ammoCount > 0) { // create a new projectile, use the same position and rotation as the Launcher. var instantiatedProjectile : Rigidbody = Instantiate (projectile, transform.position, transform.rotation); // Give it an initial forward velocity. The direction is along the z-axis of // the missile launcher's transform. instantiatedProjectile.velocity = transform.TransformDirection( Vector3 (0, 0, initialSpeed));

lastShot = Time.time; ammoCount--; } }

The script is overwriting target in the Start function with a random object which is tagged "Player". If you have exactly one object tagged Player you won't have to worry about that, just tag the object you want the thing to shoot at "Player" and remove the tag from the thing you don't want it to shoot at.