Public variables not showing up
Hi, this is my first time using this website and new to C# so sorry if I'm doing anything wrong or is a simple solution but I've stuck here trying to understand why are these public variables not showing up in the inspector, I did other small project for testing with a similar code and worked perfectly fine but now I've been searching for hours and can't seem to find a way to fix this
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Game_Controller : MonoBehaviour
{
public GameObject enemy;
public Text scoreText;
public Text shipsText;
public Text levelText;
public Text hiscoreText;
private int levelNumber;
private int score;
private int hiscore;
}
Did you add this script to a game object in the Hierarchy tab, and then selected that game object, and made sure the Inspector isn't locked (look at the top right corner of the Inspector tab for a lock icon - make sure it looks opened)?
EDIT: I just tested it, and it should work just fine
Your answer
Follow this Question
Related Questions
Can't drag objects into the script's Object Inspector public variables 1 Answer
How do I bind the value of a public variable from the inspector to some other variable/constant? 0 Answers
Why is Unity showing the wrong variables in the Inspector? 1 Answer
Public Variables Not Displaying In The Inspector 1 Answer
Create "Optional" public variable that won't throw an error 1 Answer