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.