Here are the main potential causes:
- The script file must be attached to the node. If there's a script icon next to it, click it to ensure it's the correct file. If not, it won't run, and you won't see the gravity variable in the inspector.
- You need to reload the scene or restart the editor. In some rare cases, you might need to do that for the file to execute again.