Forum rules - please read before posting.

Automatic inventory management

Is there a way to have inventory items automatically move "inward" (towards the first slot) whenever a slot is emptied from its content?


  • AC or Unity UI-based menu?

    This should already be the case, so long as Items can be re-ordered in Menu? is unchecked in the Settings Manager's "Inventory settings" panel.

    Otherwise, you can hook into the OnInventoryRemove custom event to modify the list of inventory items directly:

    using UnityEngine;
    using System.Collections;
    using AC;
    public class ClearEmptyInventorySlots : MonoBehaviour
        private void OnEnable ()
            EventManager.OnInventoryRemove += OnRemoveInventory;
        private void OnDisable ()
            EventManager.OnInventoryRemove -= OnRemoveInventory;
        private void OnRemoveInventory (InvItem _item, int value)
            KickStarter.runtimeInventory.localItems.RemoveAll (delegate (InvItem o) { return o == null; });
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.