# C# Reference

**URL:** https://discussions.unity.com/t/c-reference/67191
**Category:** Questions & Answers
**Created:** [March 28, 2013, 8:39pm UTC](https://discussions.unity.com/t/c-reference/67191 "2013-03-28T20:39:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![davidflynn2](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@davidflynn2](https://discussions.unity.com/u/davidflynn2)
#### Post date: [March 28, 2013, 8:39pm UTC](https://discussions.unity.com/t/c-reference/67191/1 "2013-03-28T20:39:40Z")

</div>

I have an on click command set up on a couple of my objects what I am needing help doing is when an object is clicked it sets is transform as the engineGEO of the FindProceduralProperties.cs script. The FindProceduralProperties.cs script has a public Transform called engineGEO. This script is on an object called MyGui.

```
using UnityEngine;
using System.Collections;

public class OpenLids : MonoBehaviour 
{
	
	public GameObject thiscrate;
	public GameObject info;

void OnMouseDown() 
	{
    	info.SetActive (true);
		GameObject varGameObject = GameObject.Find("MyGui"); // Finds the main ship
		varGameObject.GetComponent<FindProceduralProperties>().engineGEO = thiscrate.transform; // Finds the fly script and turns it off if we die
	}
void FixedUpdate ()
	{
		if (Input.GetKey ("escape"))
		{
			GameObject varGameObject = GameObject.Find("MyGui"); // Finds the main ship
			varGameObject.GetComponent<FindProceduralProperties>().engineGEO = null ; // Finds the fly script and turns it off if we die
			info.SetActive (false);
				
		}
	}
	
}

```

---

<div class="post-metadata">

### Author: ![davidflynn2](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@davidflynn2](https://discussions.unity.com/u/davidflynn2)
#### Post date: [March 28, 2013, 9:24pm UTC](https://discussions.unity.com/t/c-reference/67191/2 "2013-03-28T21:24:57Z")

</div>

It was working the script that loads the substance had the old one loaded and would not load a new one so I ended up having to change the hole setup arround. Thanks for every ones help.
