Raycast force

I have a problem. I am trying to make a raycast trigger, that when my mainObject collides with the otherObject, the manObject shall the mainObject give the otherObject a force so it it flies up in the y axis.

here’s my script so far:

         var Size = 0.000;



function Raycast () {



         var collision = Collision;



        var up = transform.TransformDirection(Vector3.up);



       Debug.DrawRay(transform.position, -up * Size, Color.green);

                  

	   if (Physics.Raycast(transform.position, -up, Size))

	   {

	       Debug.Log("Hit");

	        Destroy (gameObject);

	        

	        

	  }

	  }

Heres the force script

rigidbody.velocity = new Vector3(0, 0, 0);
        rigidbody.AddForce(new Vector3(0, 700, 0), ForceMode.Force);

what happens atm?

maybe try a different forcemode

Ive attached the Raycast code on the “otherObject”. then when my mainObject triggers the raycast it will get the force…

anyone?

you havnt really said what the problem is…

I do not know what to write to make the “mainObjekt” receive force when it triggers the raycast that is attached to the “otherObjekt”.
I have the parts of the scripton my previous post, but the problem is that i do not know how i should write the script.