Everytime I click the GUI I make it loads the first level “Castle1” when it should be loading either “Castle2” or “Castle3”. I’m assuming this has something to do with the fact that I’m not using Else If correctly, but how exactly do I use it if I need to use several of them in succession?
Your brackets are unmatched - that code sample shouldn’t even compile (unless you’ve got a whole load of }s at the end that you missed off your code sample). Try this instead:
Or consider using switch, this script from the tutorial video for Switch Statements
using UnityEngine;
using System.Collections;
public class ConversationScript : MonoBehaviour
{
public int intelligence = 5;
void Greet()
{
switch (intelligence)
{
case 5:
print ("Why hello there good sir! Let me teach you about Trigonometry!");
break;
case 4:
print ("Hello and good day!");
break;
case 3:
print ("Whadya want?");
break;
case 2:
print ("Grog SMASH!");
break;
case 1:
print ("Ulg, glib, Pblblblblb");
break;
default:
print ("Incorrect intelligence level.");
break;
}
}
}