Make object move when another object passes a trigger

Hey guys, this is my first post so I apologize for my noob-ness. I’ve been teaching myself Unity for a few weeks, but this is my first real Unity scripting. I have a mesh collider setup with a trigger that detects when this certain ball rolls through it. I’ve been able to detect it is working by a debug statement. I cannot however, figure out how to make the cube next to it move from the trigger. Here is the code I have working so far:

function OnTriggerEnter (myTrigger : Collider) {
 if(myTrigger.gameObject.name == "ball2"){
  Debug.Log("Box went through!");

  
 }
}

This is in JS, but I’d prefer C#. Should I make my if statement call to another script that is attached to the separate object that I want to move? Thanks.

Hey, it would be something like this. Do test the code! You usually need to change a few small bits.

using UnityEngine;
using System.Collections;

public class MYCLASSNAME : MonoBehaviour {
void OnTriggerEnter ( Collider myTrigger ){

if(myTrigger.gameObject.name == “ball2”){

Debug.Log(“Box went through!”);

}

}