Hello, I’m entirely new to coding and am starting a coding course next year - so I wanted to jump right in and learn some stuff about c# before I started.
To do this I’m using Unity. Basically, in my main menu, I want my camera to pan up when the space button is pressed (it’s a main menu animation). Here’s my code:
using UnityEngine;
using System.Collections;
public class Mainmenustart : MonoBehaviour {
public bool animation_bool;
void Update()
{
if(animation_bool == true)
{
Animation.Play("Main_Menu_Pan");
}
if(Input.GetButtonDown("space"))
{
animation_bool = true;
}
}
}
}
The problem arises when I try to play my game - it says there is a compile error? If you guys could point out the error in easy-to-understand terms that’d be great! I’m doing beginner tutorials for C# too, but they obviously don’t apply to well in the context of executing animations like this.
Thanks!