Item / Weapon Selector Metal Gear Solid Like "L" Carousel

Hi all, this is my first comunity question, im newbie in unity and a Junior programmer at all, starting a project for a game that has an Selector display for Items and Weapons for separate on game of the player Inventory and a selector always on the same position controlled all with Keyboard/Gamepad.

Maybe you all can remember the old MGS1 Inventory Selector where items are added on “L” position this way:

5

3

1

0 2 4

Original MGS1 Screen :

Each number corresponding on the position / Slot was appearing in the Inventory/Selector and the player can Slide this Slots with the arrow Keys and Select the Item always is at the 0 position, while you are Sliding the slots are in an infinite loop where the Slot exiting from one side of this “L” mask its returning from the other Side.

Well… I dont know if I’m explaining well at this, but thats what I want to achive . At the moment I have a prefab of the Slot Gameobject ( The frame , The Background ( Only blue when item is at pos 0 “Selected”) ,The item Name Text and the Ammount of that item Text “0/0” format ) . This Slots at the moment theyre created from Instances of this prefab GameObject dynamiclly with an offSet X or Y calculation when the item %2 != 0 for the vertical or horizontal positioning of this “L” display , but Im not sure if this is the best solution for this problem.

The Gameobjects are instanciated on a Panel with an “L” mask image inside the HUD_Canvas Ive created.

So for resume, what Im asking its how can I achive this “L” infinite Carousel effect Inventory display and Selector the best Easy Way in your Opinion Like Metal Gear Solid 1 on Psx please, because Im really stucked on this at the moment.

Thank you in advance.

Something Like this should be the position of the slots, only displaying the L mask 5 items vertical 4 horizontal, but it should be created dynamiclly , so the 14 slots cant be created at start right? and im a litle in trouble to achive it, any help or Suggestion please?

This is only a partial answer, but I hope it points you in the right direction.

You can use a Queue data structure to create the behavior you want. You can read all about how C# implements Queues at Queue<T> Class (System.Collections.Generic) | Microsoft Learn , but here’s the relevant portion:

Objects stored in a Queue are inserted at one end and removed from the other.

So when you have an item go to the “Current” position, it is the first item in the Queue. If you scroll past it, you Dequeue that object (remove it from the queue) and then Enqueue (add it to the queue). This automatically places the object at the very end. As you keep scrolling through, you’ll eventually reach that object again and the cycle repeats.

You can also use the Queue’s indices to help place objects in the right place on the screen. The object with index 13 goes in the spot labeled Item 14 in your diagram.