How do I set the quantity to spawn an actor from class?

Hi guys, I’m making an inventory system and when dropping an item I want it to be dropped as a single object but with the stacked quantity the player selected.
This is the code when the system drops the item, but it drops the default quantity that is in the item blueprint. How do I set the quantity to be dropped to the amount I want?


How do I edit this quantity when spawning the actor from class?

Hey there @guileallima! Welcome back to the community! In cases where you need to make changes to an instantiated actor, even on it’s components, you can access them directly from the return reference like the image below:

Thank you for the reply sir!
How do I call that since the item data is a pure funcion?


If I’m not mistaken, the pure function status of the GetItem function shouldn’t change how you access the spawned item inside the ServerDropItem Event. Try seeing if you can find a reference to AC_ItemDataComponent. If not, you may need to cast, though I don’t believe a cast is necessary since it has a direct ref.