Major Error - Unity ninja's required !!! - Scene + Script"freezes"

Morning ninja’s ( or whatever time it is wherever you live) .

I have a big problem . So Here we go …

I have a scene . When I play it everything goes fine , it works normally how it’s meant to . When the player dies a button is instantiated . When I click it , it takes me back to the menu . At the menu I press the button to load the same scene . And It just stop’s working . everything apart from one script doesn’t working . The only script that works is a Update on any key down translate up by 1 . 5 hours ago when I tested it.
Other notes I got these errors which I can’t decipher —

-D3D device reset failed [invalid call]

-FAILED(hr)

-allocation 0x00000000 already registered @ C:/BuildAgent/work/d3d49558e4d408f4/Runtime/GfxDevice/d3d/D3D9VBO.cpp:l687 size 1048576; now calling from C:/BuildAgent/work/d3d49558e4d408f4/Runtime/GfxDevice/d3d/D3D9VBO.cpp:l687 size 1048576?

-allocation 0x00000000 already registered @ C:/BuildAgent/work/d3d49558e4d408f4/Runtime/GfxDevice/d3d/D3D9VBO.cpp:l687 size 1048576; now calling from C:/BuildAgent/work/d3d49558e4d408f4/Runtime/GfxDevice/d3d/D3D9VBO.cpp:l526 size 196560?

SUCCEEDED(hr)

FAILED(hr)

it worked perfectly have a feeling the problem is down to one of two things ------

I created a x86 64 build , after switching back to the pc platform this morning .

OR

One of these scripts

var speed = Random.Range(100,150);
function Start(){
var speed = Random.Range(100,150);
}
function Update(){
this.transform.Translate(Vector3(speed ,0,0) * Time.deltaTime);
}

var speed : float = -10;
function Update () {
this.transform.Translate(0,0,speed * Time.deltaTime);

}

Help me Obi wan Ninjobi’s, your my only hope …

You have to declare speed outside of the function to make update work properly, but in Start() you don’t need to redeclare speed.

“var speed” creates a new variable called speed. Your first 5 lines say:

Create a global variable named speed, set it to a random range.
Then create a local variable to the start function, and set it to a random range.

I doubt that this is your problem, but your script should be:

var speed;
function Start(){
   speed = Random.Range(100,150);
}
function Update(){
    this.transform.Translate(Vector3(speed ,0,0) * time.deltaTime);
}

Actually, now that I think about it, that very well may be the problem because of the initialization outside of a function.

GOOOD NEWS ! I FIXED MYSELF , SORRY GUYS ! THERE WAS A TIME.TIMESCALE = 0 I FORGOT TO REMVOE FROM A SCRIPT WHEN I WAS PLAYING AROUND WITH IT THE OTHER DAY . HUZZZAAAAAH !