I want to do the following :
public void ChangeAnimTo(string animStateName)
{
_animator.play(animStateName)
}
The issue with this is that the Play function needs a string to be put in quotations so it doesn’t accept
.Play(string) and only accepts .Play(“string”)
But if I use .Play(“aimStateName”) it takes this literally as the stateName and a not a parameter wich
changes itself to whatever string I put into the ChangeAnimTo() function.
I wanted to make a helper function wich inserts " at the beginning and end of the string and uses that for the play function but that obviously also doesn’t work because you cant insert a string thats string str1= " " ".
how can i make the play function take a undefined string?
or do I have to manually call the play function for every single animation state change?