How animation works in run time?? when i play the scene, i seperately have to play it

Hi,

i animated an object, but when i press the play button, the animation doesn’t works, i need to seperately play the animation…what to do in order to make it playable at run time ??

If you want the animation to play as soon as the game starts, click on the game object in the Hierarchy view, then in the inspector panel you should see an animation section. Make sure the default animation is set to the animation you want to play and check “Play Automatically”.

If you want to trigger the animation from a script, take a look at Unity - Scripting API: Animation

hii, i tried as u explained…

see the image

there is 1 error coming when i drag the anim file to Animation… Animation does not start if i do not drag the file, error and animation both comes when i drag animation file to Animation…

in front of element 0, animation is pre assigned and Play automatically is also ticked by default…

  1. please tell me how to remove this error and how to make this in loop ??
  2. how can i change the camera angle of Third person shooter ?

What was the error saying…?

Where did you drag the animation file from?

how i drag -

i select the object [dog-braco] from hierarchy and drag it to the inspector under “Animation” , there is a field “Animation” , i drag the animation script seen under “Project” to it…

then 1 animation cycle starts but not loop , with an error in console

NullReferenceException: Object reference not set to an instance of an object

see the image you will understand everything