I'm trying to have enemies display a simple sprite of the item it is carrying (when it is carrying one it can use in battle), so the player has a small preview if they know the item by the sprite.


What would the best way to link that information to a visual icon or prefab that activates on combatants?
  • Hm, I don't think this is possible out of the box.
    It'd require a bit of custom scripting to get the inventory content of the combatant and display it in a UI.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • What about a variation that simply shows when an NPC is holding a certain type? IE checks item box for item type and displays generalist prefab if any is detected
  • Actually, I thought of a way to show the enemy's items - via shortcut slots.

    In Menus > Shortcut Settings you can set up Auto Add Slots (each combatant can also override/add to it). They automatically assign shortcuts (e.g. an item or ability) to a slot when the combatant gets it.
    You can also limit what kind of shortcut/item is used, e.g. only useable items of defined item types.

    So, when the combatant is initialized and it gets it's inventory items, they'd automatically be assigned to slots you set up, which you can show in Combatant HUDs using a Shortcut HUD element.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • That's an awesome work around! In the Shortcut HUD, I'm trying to get the Icon to display. Do I need to add a Content Label in Shortcut Settings to make the item related icon display as part of the HUD?
  • Exactly, the content labels are used to add text, icons, etc. to display a shortcut's content information.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.