OnTrigger & OnCollision not working?

Alright, so I’m building a paper airplane simulator for school, and though I’m very new to javascript, I think I’m doing alright for a beginner.
My problem is, I have a script called “blowWind”, which is as follows:

var power : float = 1000.0;

function OnTriggerEnter ( trigger : Collider ) {
    if (trigger.gameObject.name == "paper plane") {
    	Debug.Log("Hit the trigger");

I have this script applied to some transparent cubes I created for triggers that have a box collider, and IsTrigger is checked. When I launch my plane, it flies, but when I hit a trigger, it doesn’t have power added to it. It doesn’t even show up in the console with my debug statement, “Hit the trigger”.

My Planeprefab is a rigidbody, with a mesh collider on it, and convex is ticked. I have tried every friggen possibility, and I have every tutorial video from Unity 3D Videos and have watched them all, he has an example video of this very procedure, only he has it print to the console and that is all.

I am very frustrated and stuck at this point, what am I doing wrong? I’d be willing to upload my .unity package if anybody is interested in checking it out, though it isn’t quite finished.

Any and all help is greatly appreciated!!


Maybe it has something to do with the Planeprefab being a (clone)? I instantiate the prefab, so maybe that has something to do with it?

I feel like it has to do with this plane prefab. I have now attached a script to the ground so that when the paper plane hits it, it loads my main menu for the game, but it isn’t detecting the collision, both now have a box collider.

Both scenes are in the project build settings.

Here is the gameover.js:

function OnCollisionEnter ( myCollision : Collision ){
	if(myCollision.gameObject.name == "paper plane"){

Thanks for any help everybody, this is killing me.


It seems like it should be fairly straight forward, not sure what the problem could be.

I believe OntriggerEnter acts once only upon entry perhaps this is what you want if you want to give the plane one impulse.

Perhaps you script is on a parent object and the child has the collider?

Anyway I also wanted to make a script that added force to an object in a trigger.

Create a big cube, take off the renderer, drop rigidbodies into it, adjust rotation for where to push things

var forcetype:boolean;
var gravitytype:boolean;
function OnTriggerStay(other : Collider) {
       if (other.attachedRigidbody) {
         // Calculate the y-axis relative to us   
         var cameraRelativeRight : Vector3 = transform.TransformDirection (Vector3.up);
         // Apply a force relative to the our y-axis
       other.attachedRigidbody.AddForce(cameraRelativeRight * -9.81,ForceMode.Acceleration);