Script details not appearing

Hello, when I go to a script in a gameobject I cant access any of the details that I see in many tutorials, before you ask yes I did pull down the arrow button and it still wont come up, any help would be appreciated, thanks.

Hi and welcome @Splat2ooner ,

Do you mean with “details” your variables/fields and other things you expect to see in your script’s user interface?

i.e. this kind of things:

5111009--504488--script_stuff.PNG

If you see nothing, except the Script line, you need to make your fields visible.
You can do this in a few different ways:

public GameObject myGameObject;

This will make your field public and accessible by other classes, then you can see it in the UI as Unity by default serializes only the public fields.

If you want to make a private field visible in UI, you can use this:

[SerializeField] float myValueA;

Thanks for your comment, yes those are the details I am talking about. All of the variables I want to access from the UI are public but they still dont appear, I’m not too sure whats going on.

Does your script show any errors? I wonder if it’s not compiled properly.

No errors, the game runs fine, I will send the code rn

(FYI The code is not nearly done, I just couldntwork on it much more without what I am trying to do.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlatformSpawner : MonoBehaviour
{
    public GameObject platformPrefab;
    public GameObject spikePlatformPrefab;
    public GameObject[] movingPlatforms;
    public GameObject breakablePlatform;
    public float platformSpawnTimer = 2f;
    public float minX = -2f, maxX = 2f;

    private float currentPlatformSpawnTimer;
    private int platformSpawnCount;

    void Start()
    {
        currentPlatformSpawnTimer = platformSpawnTimer;
    }

    void Update()
    {
        spawnPlatforms();
    }

    void spawnPlatforms()
    {
        currentPlatformSpawnTimer += Time.deltaTime;
        if (currentPlatformSpawnTimer >= platformSpawnTimer)
        {

        }
    }
}

And you still can’t see any of the variables? I tried that here, it compiles ok and shows the fields on the UI just fine?

I wonder if your project is ok or if you have something else there that could block it from showing up.

Also, have you renamed your script file and class or done something with the file?

A few ideas:

  1. Try to reimport your script (right click menu.)
  2. Try to create a new script and copy the current script contents to it and name the class accordingly so that it matches the file. Then see if it still has this same problem.
  3. Check if you have any editor scripts running that might affect your inspector behavior.

Thank you! Re-Inporting it fixed it, much appreciated.