unity game stops when animation starts problem.

Hey i have a problem i have this script

function Update()
{
if(Input.GetKeyDown(“r”))
{
// Plays the reload animation - stops all other animations
animation.Play(“reload”, PlayMode.StopAll);
}
}

But when i ad it to my gun in unit. i start the game and it works good until i press the key i have selected, and when i press it the game kinda goes back to scene mode but the game is still running somehow…

Why is this happening???

Are you sure that the game view has the keyboard focus? Try clicking into the game view when you start the game. Another reason could be a custom editor script which registers the key has hotkey. Maybe you hit a combination of a built-in hotkey. I’m not sure if CTRL+R, SHIFT+R or ALT+R is a built in hot key as well. If it is there’s no way to disable the hot key. Either find a different key or you have to create a build to test it.

edit
I just arrived at my PC ^^
I still use Unity 4.0.1 and there is no hotkey with the R key maybe there’s a new hotkey in the current version, but i doubt it. However if you press CRTL+1 Unity would switch to the sceneview. CTRL+2 would switch back to the gameview. CTRL+P would toggle playmode and CTRL+SHIFT+P toggles pause. If you need those combinations in your game, you can’t test those in the editor.

Heres a list of (most / all?) hotkeys in Unity however, as i said, maybe there’s an editor script which reacts to the “R” key.