I have an animation clip called “slideAnimClip” which runs perfectly when I play the game. However it’s a prefab and I want many of these to be on the screen running at different speeds depending on circumstance.
Here is my script
using UnityEngine;
using System.Collections;
public class slideBangScript : MonoBehaviour {
public float animSpeed = 1f;
public Animation anim;
void Update () {
Animation["slideAnimClip"].speed = animSpeed;
}
}
I think this should be correct, but I keep getting this error:
Assets/Scripts/slideBangScript.cs(12,9): error CS0119: Expression denotes a
type', where avariable’,value' ormethod group’ was expected
I’d be extremely grateful for any help.
Thanks.