So at home I have 2 slowmotion scripts that work perfectly with no errors and at home I have unity version 4.3.3
So I tried opening my project at uni which has the older version of Unity, version 4.2.1f4
and before it said I could risk data loss and after importing it I got hundreds of errors that are cleared after I press clear except for these 2 scripts that give me these errors
Why is this happening?
Assets/Scripts/SlowMotion.js(30,2): UCE0001: ‘;’ expected. Insert a semicolon at the end.
Assets/Scripts/SlowMoTrigger.js(39,2): UCE0001: ‘;’ expected. Insert a semicolon at the end.
var currentSlowMo : float = 0;
var slowTimeAllowed : float = 2.0;
var b : boolean = false;
function OnTriggerEnter (player : Collider) {
if(player.tag=="Player")
b = true;
}
function Update()
{
if(b == true)
{
if(Time.timeScale == 1.0)
Time.timeScale = 0.3;
else
Time.timeScale = 1.0;
Time.fixedDeltaTime = 0.02 * Time.timeScale;
}
if(Time.timeScale == 0.3)
{
currentSlowMo += Time.deltaTime;
}
if(currentSlowMo > slowTimeAllowed)
{
currentSlowMo = 0;
Time.timeScale = 1.0;
b = false;
{
}
}
}
I just don’t understand why it’s working at home but not at uni, but after I imported my file from home at uni with the risk of data loss I also got these errors which are cleared after pressing clear.
Anybody? Would the best solution just be to contact my uni technicians to upgrade Unity to the version I am using at home which gives me no errors on the scripts above.
That message usually appears when you open an existing Unity project with an older version.
Just check your scripts at home. If they work there, they will work elsewhere too.