> For the complete documentation index, see [llms.txt](https://steijn.gitbook.io/devlogs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://steijn.gitbook.io/devlogs/devlog-personal/duos/barricade-selection.md).

# Barricade selection

What's a good way to implement a selection system.

Our barricades will need to be selected, which require a UI with buttons leading to refunding and an inventory selection&#x20;

Since the barricade selector was already made by my peer, it was rather simple to implement, all i needed to do was use the currently selected barricades position to move the UI and make it use the selectedbarricade access

&#x20;<img src="/files/-MY4DBeKOHZNamHxkSav" alt="" data-size="original">&#x20;

After this i had to make it so the UI always faced the camera, this makes it so you can always click it.

&#x20;`transform.LookAt(target.position);` &#x20;

This caused a slight issue, it would be mirrored.

&#x20;<img src="/files/-MY4ES89RBg9cfnRNmGq" alt="" data-size="original">&#x20;

This can be fixed by using the following formula instead:&#x20;

`transform.LookAt(2 * transform.position - target.position);` &#x20;

{% embed url="<https://imgur.com/H7sjIe3>" %}
