Unity is indicating this error when starting the game:
ArgumentException: Index out of bounds.
ControllerTree2.Update () (at Assets/Scripts/ControllerTree2.cs:14)
using UnityEngine;
using System.Collections;
public class ControllerTree2 : MonoBehaviour {
Animator TrunkAnimator;
// Use this for initialization
void Start () {
TrunkAnimator = GetComponent ();
}
// Update is called once per frame
void Update () {
Touch touch = Input.GetTouch(0);
if(touch.phase == TouchPhase.Began){
if(touch.position.x > Screen.width/2){
//left
TrunkAnimator.SetBool ("Attack2", true);
TrunkAnimator.SetBool ("Stop2", false);
} else {
TrunkAnimator.SetBool ("Attack2", false);
TrunkAnimator.SetBool ("Stop2", true);
}
}
}
}