# I am trying to get a variable from a struct at a clicked location on a grid  

**URL:** <https://forums.unrealengine.com/t/i-am-trying-to-get-a-variable-from-a-struct-at-a-clicked-location-on-a-grid/2494795>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question, structs\
**Created:** [May 7, 2025, 4:41am UTC](https://forums.unrealengine.com/t/i-am-trying-to-get-a-variable-from-a-struct-at-a-clicked-location-on-a-grid/2494795 "2025-05-07T04:41:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeVapor1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CodeVapor1](https://forums.unrealengine.com/u/CodeVapor1)\
**Post date:** [May 7, 2025, 4:41am UTC](https://forums.unrealengine.com/t/i-am-trying-to-get-a-variable-from-a-struct-at-a-clicked-location-on-a-grid/2494795/1 "2025-05-07T04:41:45Z")

</div>

![Screenshot 2025-05-06 222315](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/4/984f42ed76464ee1d88541e93bfe8cd0ac792917.png)  
I asked chatgpt for a little help with not looping though every slot i have in the grid and instead just getting the index from the slot i clicked on, but it told me to get the array of structs(in my case the Grid\_Slot struct) from the elements tab, the issue with this is it wants me to get the “Slot index” variable that is being passed into my custom event as seen below. but when you “get” the struct its not like it has input pins.  
 ![Screenshot 2025-05-06 213514](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/7/1/d7113dc4ac5e27f945ac86a74b363be4bff581b9.png)  
if you guys have any advise or a better way of explaining what it suggested i would really apricate it.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 7, 2025, 5:38am UTC](https://forums.unrealengine.com/t/i-am-trying-to-get-a-variable-from-a-struct-at-a-clicked-location-on-a-grid/2494795/2 "2025-05-07T05:38:53Z")

</div>

What GPT is saying is, drag from this

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/5/d454bf5de39b00689c6e9c8da530bec386f1ef68.png)

and get the slot index which should be a parameter on that custom event node.

I don’t know if that makes sense. If it doesn’t, that’s pretty typical GPT… 🤣

---

<div class="post-metadata">

**Author:** ![CodeVapor1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CodeVapor1](https://forums.unrealengine.com/u/CodeVapor1)\
**Post date:** [May 7, 2025, 6:05am UTC](https://forums.unrealengine.com/t/i-am-trying-to-get-a-variable-from-a-struct-at-a-clicked-location-on-a-grid/2494795/4 "2025-05-07T06:05:42Z")

</div>

![Screenshot 2025-05-06 234957](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/2/2/32258466afbddd1c256ddc8291611883a5638829.png)

maybe i just have this set up incorrectly (also i kind of suck at this stuff) but when i try and grab from the grid slots array i cant get the slot index i don’t know if i need it set up as its own var or something

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 7, 2025, 8:17am UTC](https://forums.unrealengine.com/t/i-am-trying-to-get-a-variable-from-a-struct-at-a-clicked-location-on-a-grid/2494795/5 "2025-05-07T08:17:02Z")

</div>

What it says is

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/a/e/2ae08c97fd5afd01238ca8af9650d834c4598253.png)

Like I say, might not be what you want 🙂

---

<div class="post-metadata">

**Author:** ![CodeVapor1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CodeVapor1](https://forums.unrealengine.com/u/CodeVapor1)\
**Post date:** [May 7, 2025, 10:49pm UTC](https://forums.unrealengine.com/t/i-am-trying-to-get-a-variable-from-a-struct-at-a-clicked-location-on-a-grid/2494795/6 "2025-05-07T22:49:52Z")

</div>

ohhh i see what your saying, okay I apologize for my confusion
