How to change animation speed

I am using this: gameObject.GetComponent<Animation>().Play (); to play an animation. the animation I want it to play is attached to the object in unity and it works perfectly, however I want to double the speed of the animation via this script. I have tried hundreds of different options however they all appear to be out dated because none of them have worked.

1 Answer

1

Try this: Unity - Scripting API: AnimationState.speed

The only problem with that is there is not an example in c# and I don't know how to convert javascript to c#