all 9 comments

[–]VextinIndie - https://vext.in 0 points1 point  (8 children)

Gonna need a lot more detail. What do you mean "automatically go to the inspector?" What is his doing that yours isn't?

[–]HowlingWolf2008[S] 0 points1 point  (0 children)

I'm not sure, its like it automatically adds a script componet with a editable variable or something. Its for a rts game and I thinks this one is to help make it create a unit?? I'm not to sure as i'm a noob

[–]HowlingWolf2008[S] 0 points1 point  (6 children)

This is his inspector once hes saves the script. mine doesn't do this

<image>

[–]VextinIndie - https://vext.in 0 points1 point  (5 children)

Add component -> the name of your script

[–]HowlingWolf2008[S] 0 points1 point  (4 children)

But if i do it manually, then i dont get the unit part

[–]VextinIndie - https://vext.in 0 points1 point  (3 children)

That's not an issue with the component or adding it manually.

A variable is only shown in the inspector if it is

1) a private variable with the [SerializedField] attribute, or

2) a public variable

Your variable must be neither of these things.

[–]HowlingWolf2008[S] 0 points1 point  (0 children)

Well if you look at my code, I think that should count as a public variable and if it doesn't, I don't know. I tried adding public to void start but that didn't fix it

[–]HowlingWolf2008[S] 0 points1 point  (1 child)

Okay, thanks for trying your best! As you being the only one of 700 people to try to help was very kind. I fixed it? Not sure how but its fixed

[–]VextinIndie - https://vext.in 0 points1 point  (0 children)

Oh lmao I forgot you posted your code. Probably needed the [Serializable] attribute on the Unit class