So I have this code to play an animation, and wait 0.3 seconds. But for some reason I get the “} Expected” Error after “void Update () {”. Here is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class splatanimhandle : MonoBehaviour {
public Animator splat;
public bool isOnTitle;
// Use this for initialization
void Start () {
StartCoroutine ("splatScene");
splat = GetComponent<Animator> ();
isOnTitle = true;
}
// Update is called once per frame
void Update () {
IEnumerator splatScene() {
if (Input.GetKeyDown (KeyCode.Space) == true) {
if (isOnTitle == true) {
splat.Play ("splatanim");
isOnTitle = false;
}
}
}
}