Variables / Fields Not Appearing in Inspector?
Last updated
Last updated
The video below will explain how to add fields or variables to the DoorInteractable script as it uses a custom inspector
Add a field as below into the DoorInteractable script
[SerializeField] private GameObject exampleField = null;
Open the DoorInteractableEditor script - At the top of the script created a new property with the same name like:
SerializedProperty exampleField;
Find the OnEnable() method and add a new find property reference as below:
exampleField = serializedObject.FindProperty(nameof(exampleField));
In the methods below that, find a place for your new field. I've grouped them together to make it more readable. Add a property GUI field:
EditorGUILayout.PropertyField(exampleField);