Unassigned Reference Exception, Variable not Assigned – Unity3D

The syntax error this time is : “UnassignedReferenceException : The variable XYZ of ABC.csharp has not been assigned”

This error says that you have declared a variable and used is as a GameObject, but no GameObject in the Scene has been assigned to the variable.

public GameObject camera;
 void Start () {
 camera.gameObject.SetActive(true);
 }

Therefore, you have to assign the variable camera, for example, to an object which is tagged in the Inspector. Let us say that the Object Main Camera in the Hierarchy is labelled as MainCamera in the Tag field, to assign the variable camera to the Object Main Camera, the code should be written as follow :-

public GameObject camera;
 void Start () {
 camera = GameObject.FindGameObjectWithTag("MainCamera");
 camera.gameObject.SetActive(true);
 }

 

Capacitance Tests Good But Not ESR

A measure of capacitance on a capacitance meter might show value similar to the label on the capacitor's cylindrical body. However, it is not only the capacitance that ensures functionality. Another measurement that needs to be considered is the ESR … [Continue reading]

Outcome-based Education Workshop from Rose-Hulmans’

Measuring what students know, developing and deployinh classroom assessment techniques (CATs). Electronic Portfolios, student Learning and outcome Assessment, using digital resources to improve student learning and reflection. Constructing program … [Continue reading]

Arduino Workshop Biomedical 2014

Five participants learned to program acquiring electrocardiogram (ECG) and photoplethysmograph (PPG) signals, applying simple signal processing techniques and plotting them on the graphic LCD. … [Continue reading]

Trip to Caterburry University, Christchurch, New Zealand

The Postgraduate Certificate in Antarctic Studies (PCAS) is a fourteen-week programmed focusing on the issues of Antarctica. … [Continue reading]

Today HCI class

To my HCI student. today class will discuss about your project … [Continue reading]

HCI short drama

The User is a King and an example of Short Drama from Stanford University. This could give some inspiration to your group presentation … [Continue reading]