Trouble Getting Visual Representation Working

Hey Everyone,

Before I get into a description of the issue, I would just like to say that the blueprint work is by far not my finest, I’m 10000% Adamant there are better ways to achieve this effect but for some unknown reason my brain fails to think of them. I’m usually quite good solving logic based problems but this one is really stumping me. So here we go…

I’m working on a personal project that is somewhat a supermarket simulator all be it less micro-managing. The project is a C++ as I have recently started getting back into it after a long while away from programming.

Q: What is the most common/simplified way to represent a visual change in Blueprints based off a given value.

Example: Currently I have a Delivery Truck which has an inventory. Once the truck arrives at the unloading area. It proceeds to unload X amount of products per second. For each lets say 100 of X I would like a static mesh of a box to be placed on the loading area(A pallet).

Example2: I intend to have the quantity of products on a shelf visually represented. Not 1 for 1 but by whatever factor I decide, for example 10 bread in value would represent 1 physical bread on the shelf.


This Code (Despite how monstrous ) Effectively unhides a box for every 100 of a product the unloading area has. This works successfully however I’m unsure how to even reverse this so the boxes also disappear when products are taken out of the unloading area.

Like I mentioned before though, This is a C++ project so the more I can do in code than blueprints the better. I was just assuming that visual effects like I am trying to obtain would have been easier in Blueprints. I have just tried to put as much Information in this post as possible as I find it hard to even explain what I mean.

Many Thanks
Alex

You can make them all hidden first, then the loop will work for any number.

Also, you can avoid all that code, because ‘display index’ is just ‘pallet current amount’ / 100 :slight_smile:

Hi ClockworkOcean!

Thank you for your feedback I have now done as suggested, Definitely reduced the amount of mess.

I have now gone back and reworked it as It is functioning as intended! So thanks for giving me that push!

Before I mark the question as answered though I have still been wondering what the best practice is for achieving these effects. Is simply hiding/unhiding the meshes the universal way to do it? Or is there another industry method used.

Many Thanks
Alex

I would say, if you want to move items from the truck to the pallet, then just use ‘set actor location’?

You also can’t get the numbers wrong then… :slight_smile:

Hey ClockworkOcean,

I’m going to be having AI collect 1 box (100 items) at a time from the truck and place it on the pallet. I now have the base logic for that setup onto the AI!

Thank you again
Alex