Idle animations

Hi , so basicly when im holding no buttons/keys down , i want my camera and/or gun to play a small animation and i want it to loop until i press any button again , Also is there any was to make unty run faster , i have a flat terrain with 3 cubes and a floor texture and it lags unless i put it on lowest quality . Thanks

If you’re using the Animator (i.e. for Mecanim), then you should assign your idle animation to the default state, and ensure that state transitions are created to return to that state from all other states after they finish playing. Like this:
alt text

If you’re using legacy Animation system, then in your Update loop when you check for

if(Input.GetKeyDown("Left")) {}
else if(Input.GetKeyDown("Right")) {}
else if(Input.GetKeyDown("Fire")) {}
... etc

just add an additional else clause at the end, which will only be reached if none of the above keys are being pressed, and then in that clause set IdleAnim.Play()