I need a way to get a gameobject trough the charactercontroller

I have a script but it isn’t working

as you see in the question that’s my question here is what i have so far

var target : GameObject;

function Start () {


function Update () {


function OnCollisionEnter(collision : Collision) 
	target = collision.gameObject;

I’m assuming this script is attached to the character? Is so you want to use OnControllerColliderHit(). Character Controllers don’t get or generate OnCollisionEnter() calls. So if there is a Character Controller involved, you’ll have to put the logic on the character. If you need to transfer the info to another object, you can use GetComponent() on the other object.