I’m using the standard first person character controller that comes with Unity. I removed the pill mesh and added my own character with animations that are split and named appropriately. How do I get the correct animation to play based on the key that is pressed? Is there a script that I can use or download from somewhere? I looked at the Third Person Controller script that comes with Unity and that has the code built in. Is there anything out there for the First Person Controller?
I think the best way to solve your problem is to write simple script that is cheking for key imput and then play the animation something like this:
If (Input.GetKeyDown(KeyCode.W)
{
animation.Play(aniamtion name)
}
this is only an example how understand it and maybe it wil work. Then this script put on the game object with animation.
Your own script have a lot more advantage than a script downloaded from web. A the begining of knowing Unity i used a lot of scripts of other people and then i was trying to understand them. But that was not the way. Now i only look at thinks that i cant make and then im trying to write my own version. Version that i fully understand
(Sory for my gramar mistakes but english is not may native language)