Deactivate Controlle of one object and Contoll another

I have a space ship you can fly around and do all sorts of cool things with but I want to make it so when it get in range or Collides with a trigger of the big ship it switches the controlls over to it. I plan to have the big ship just siting out in space so i can have all my scripts on it and they will just be turned off. I am just unsure how to go about turning a script on/off during a collison.

You can get scripts using GetComponent, like so (c#):

MyScript script = myShip.GetComponent() as MyScript;

Once you have the script, you can turn it off with .enabled:

script.enabled = false;

If you have a lot of scripts to turn on and off, it might be nice to have one script (per ship) that has knowledge of all of the other scripts, and has a method that will turn them on or off. The signature would be something like this:

void EnableScripts (bool enable);

Good luck!

also assuming its a collision the function your looking for is.

void OnCollisionEnter()
as documented at

alternetly if you want it to be a trigger its

void OnTriggerEnter()

simply add a blank script to the object that will be hit.
for example

//destroy thing that hit me
void OnTriggerEnter(collider thing_that_hit_me)

//disable the controls for what hit me and enable mine

void OnTriggerEnter(collider what_hit_me)
    //enable the big ships controls assuming the big ship is 
   // what this script is attached to
    GetComponent<ship_controls>.enable = true;

   //disable the ship that hit me.
    what_hit_me.GetComponent<ship_controls>.enable = false;


hope that helps