Just a thought

Wanted to share an idea to see what people thought.

I got tired of not seeing my PickupSpawners (the gizmos just don’t do it for me)

So, I added a Capsule(could be any gameObject) to my PickupSpawner prefab.
I named it PlaceHolder.

Then I can see my Spawners by that capsule.

Changed the script a little.

Added a SerializeField:

    public class PickupSpawner : MonoBehaviour, ISaveable
    {
        // CONFIG DATA
        [SerializeField] GameObject placeHolder = null; *** Added ***
        [SerializeField] InventoryItem item = null;
        [Range(1,10)]
        [SerializeField] int number = 1;

Added one line to SpawnPickup

        private void SpawnPickup()
        {
            var spawnedPickup = item.SpawnPickup(transform.position, number);
            spawnedPickup.transform.SetParent(transform);
            placeHolder.SetActive(false); *** Added ***
        }

And now I can see my Pickups without the gizmos that act funny sometimes for me…

1 Like

That’s a good technique!

Privacy & Terms