CS1513 and CS1022 problem
Heya guys,
I got a problem while i'm trying to do an "Random animation while idle", here's the code:
using UnityEngine;
using System.Collections;
public class RandomIdle : MonoBehaviour {
// Use this for initialization
void Start () {
animator = GetComponent(Animator);
}
// Update is called once per frame
void Update () {
if(GetComponent.<Animation>()["Idle"].enabled == true) { //CS1513
public int random = Random.Range (1, 4);
}
} //CS1022
} //CS1022
After I would like to set the value of a parameter in my animator section
Thanks ;)
Comment
Best Answer
Answer by darthtelle · Aug 28, 2015 at 10:02 AM
I don't believe you need the '.' after GetComponent. It should actually look something like this..
void Update ()
{
if(GetComponent<Animation>()["Idle"].enabled == true)
{
public int random = Random.Range (1, 4);
}
}