Transparent objects

I am trying to create a halo lens application that allows the user to look inside an engine. At one point the model needs to be solid, and then the user can change the transparency of the model. My code looks like this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class maketrans : MonoBehaviour {
public GameObject part1;
// Use this for initialization
void Start () {
var mything = part1.GetComponent<MeshRenderer>();
var theColor = mything.material.color.a;
theColor = 0.5f;
//mything.material.color.a = theColor;



}

// Update is called once per frame
void Update () {

}
}

If any one knows a way to accomplish this please let me know.

Please use code tags!

All the assets are untagged for testing purposes. I am trying to add a control to a model that allows the user to adjust the opacity of the model.

To change Transparency of a MeshRender you must be using a shader that supports this.

Also by Code tags he means

// This

so your code appears in a formatted state (its an option while creatying a post