using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # This is a Verse Script attached to an Item Granter or Trigger. # Note: Verse does not currently expose a direct SetClothing() API for # MetaHumans. The pattern below uses an item_granter_device to trigger # a cosmetic swap — the closest real runtime hook available in UEFN. stealth_hoodie_granter := class(creative_device): # 1. Wire this item_granter_device in the UEFN editor to the device # that holds your migrated MyCoolSweater skeletal mesh swap logic. @editable HoodieGranter : item_granter_device = item_granter_device{} # 2. Wire a trigger_device in the editor; this fires when the # player interacts with your pick-up prop. @editable PickupTrigger : trigger_device = trigger_device{} OnBegin() : void = # Subscribe to the trigger so we react every time it fires. PickupTrigger.TriggeredEvent.Subscribe(OnPlayerPickedUp) # 3. The Event: Trigger activates (player "picks up" the item). OnPlayerPickedUp(Agent : ?agent) : void = # 4. Grant the hoodie item to the agent. # item_granter_device.GrantItem() is the real UEFN API for # delivering an inventory item (or cosmetic-swap item) to a player. if (A := Agent?): HoodieGranter.GrantItem(A) # note: To swap the visible skeletal mesh to MyCoolSweater at # runtime you must set up a Conditional Button + Outfit Changer # device chain in the editor; Verse cannot directly assign a # clothing asset to a MetaHuman component at this time.