I switched to Ubuntu recently and wanted to start with Unity. Now i watched some Tutorials about Scripting and wanted to add some functionality to a simple sphere. I wrote the script in Atom and added it to a Script folder i generated in the assets. If i drag drop now the script to an object, the script cannot be runned. If i open the script it is always empty. Why is that?
Code i wanted to add:
#pragma strict
// First always define the variables i want to handle with befor starting
// with anything
private var coffeTemperature:float = 85.0f;
private var hotLimitTemperature:float = 70.0f;
private var coldLimitTemperature:float = 40.0f;
function Update()
{
if(Input.GetKeyDown(KeyCode.Space))
TemperatureTest();
coffeTemperature -= Time.deltaTime * 5.0f;
}
function TemperatureTest()
{
//This function is only here to compare given values
if( coffeTemperature > hotLimitTemperature )
{
print![("Coffe is waaaay to hot!");
}][1]
else if( coffeTemperature < coldLimitTemperature)
{
print("Coffe is waaay to cold !");
}
else
{
print("The Coffe is just fine! ");
}
}