Cool hurt animation

Hi there,

Is there an easy way to make the first person camera tilt side to side when the player takes damage?

Thanks :smiley:

Hi, @Lord_meow_Sambo

…your question is actually how to play animation from code.

Pseudo code:

Create an animation clip for some object that is your placeholder for your player head.

Create a method to some MonoBehaviour script you have.

If you are using the “new” or non-legacy animation system, in this method, trigger animation from your animator (hurt animation).

Call this method when you get hurt (use string name that matches trigger name in your animation graph):



Will that effect the player looking around?

Ok thanks.