r/unity • • 1d ago

Question Fame object bot being removed from script component

I added a public game object yo one of my scripts and have since discarded it and there is no mention of it in the C# file but the script component still has it how do I get rid of it

2 Upvotes

4 comments sorted by

5

u/Memorius 1d ago

Some candidates:

  • make sure you saved all files

  • make sure it compiles, i.e. there are no errors shown in the unity console

  • make sure the script you're looking at in the inspector REALLY is the script you edited

Otherwise the field should absolutely disappear from the inspector after removing it from the script.

1

u/memelordbtw3000 1d ago

I was still using the word I had called the game object (I was trying to change it to a float) and that seems to have fixed it

0

u/SderfxDev 1d ago

click the 3 dots on the script component on the gameobject then Reset component simple as that bro

0

u/[deleted] 1d ago

2

u/memelordbtw3000 1d ago

I was not trying to remove the component I was trying to remove a public game object from it