Simple question about Collisions

I´ve been trying to detect a Collision in the Islands Demo with an objetc exported from max…
I´ve already got this detection to work with the OnTriggerEnter, but i need the Object to have collisions with the Character, so i´ve been trying to use OnCollisionEnter with no success…

Here is the code i´ve added to the exported object (i´ve tryed to use either mesh collider, and box with no success):

unction OnCollisionEnter ()
{
	//var contact : ContactPoint = collision.contacts[0];
	Destroy(gameObject); 
	
	print("Collided");

I´ve added a Rigid Body to the Character, and the object, i´ve tryed everything and read all posts in the forum but i have no clue how to do it…

Thanks

have you store your character in the variable “gameObject”?

Are you sure that “IsTrigger” is not selected?

i´ve already tried with the OnTriggerEnter and got it to work, but the character keeps walking through the object (i don´t want it to happen)…

in the case i want to move the object when my character collides with it… in the case it would be something like:

var moveOb = false;

function OnCollisionEnter(collision : Collision)
{
moveOb = true;
}

function Update();
{
if (moveOb)
transform.translate(0,2,0);
}

yet, it works only with OnTriggerEnter (when i select the box ‘isTrigger’, i can move through it; that´s a problem.).

I do not understand! Why can’t you just unclick “IsTrigger”?

i have unclicked IsTrigger… it´s unchecked…

ok, I misunderstood. Is your character an IsKinematic?

nope… the object isn´t as well.
i´ve tryed using mesh, and box collider with the moving object, but the collision doesn´t work either way.

Could it be that:

Destroy(gameObject);

…makes the execution of the script to stop since the game object exists no more?

Try just doing Debug.Print in your method.

actually, the object doesn´t detect the collision…
I´ve tryed moving it, but it didn´t worked, so i used Destroy just as a feedback…

The problem is detecting the collision between the character, and the object.

Quick question, are any of the objects really small or moving really fast?
If so then perhaps that they is traveling at such a rate that they move -past- each other in a single frame, therefore never registering a collision.

If that is the case try looking at this on the Wiki:
http://www.unifycommunity.com/wiki/index.php?title=DontGoThroughThings

no, neither of them

im using translation 0,2,0. And the object is about 8 times the size of the character…

Well I am out of ideas, the only other thing I can think of is that perhaps the mesh got import funny.
I had a problem a while back where the center of my mesh was not at the actual center but translate off in one direction. This cause me all sorts of weird issues. I had to fix it in my 3d editor (cheetah3d) so that the center was properly located.

hummmmm… i´ll look forward it, and then i´ll reply what happened… Thanks =]