I have an animation called CharacterRotation and I want it to speed up when my character speeds up and slow down when my character slows down. How can I do that with c# code? Any and all help is greatly apreciated
Edit: So far I have this
public class RollAnimationSpeed : MonoBehaviour {
// Update is called once per frame
void Update () {
animation ["CharacterRotation"].speed = PlayerComponent.Speed / 30f;
}
}
Problem is that I don’t know how to call the PlayerComponent class to this script, if I could do that then I’d be able to do it from there.