How do I use the currency system in a shop

UE5 I was wondering how to use currency in a shopping sense and a dropping mechanic so you can give money to players or load up on supplies sell objects in different vendors gain lose money on death and while bartering.

Currency can be just an integer variable. And the rest of the answer is in you question - drag & drop.

  • the items can be represented by UI widgets
  • those widgets sit in containers - widget panels
  • UE’s UMG sports drag & drop mechanics
  • when a widget is dropped into a container, we either increase or decrees the integer variable representing currency

The player dying and losing money could a matter of spawning a new actor (bag of gold), subtracting X from our currency and setting X for the integer in the bag of gold.

Bartering can be achieved in too many ways, you probably have something on your mind already but in the end it’s would be a matter of basic math operation. The details depend on the desired implementation.

There are hundreds, or more, tutorials on YT on how to handle inventory interactions. While certain behaviors overlap, there will be as many approaches to script it as there are people. Stat with learning about widgets and how the drag & drop works.


let’s welcome them to our community!

Also, welcome! Don’t forget to have fun while digging through the docs I linked ;p

2 Likes