# How do I use "get hit result under cursor" to select an item in an array?

**URL:** <https://forums.unrealengine.com/t/how-do-i-use-get-hit-result-under-cursor-to-select-an-item-in-an-array/469056>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 2, 2020, 12:19am UTC](https://forums.unrealengine.com/t/how-do-i-use-get-hit-result-under-cursor-to-select-an-item-in-an-array/469056 "2020-08-02T00:19:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_27a1e58a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_27a1e58a](https://forums.unrealengine.com/u/anonymous_user_27a1e58a)\
**Post date:** [August 2, 2020, 12:19am UTC](https://forums.unrealengine.com/t/how-do-i-use-get-hit-result-under-cursor-to-select-an-item-in-an-array/469056/1 "2020-08-02T00:19:40Z")

</div>

Hi there! I’ve been trying to make a Civ-like game for fun but I’ve hit a slight wall. I’ve watched a few tutorials where the presenter was making a chess game and it had a highlight option where you use “get hit result under cursor” to select a square and highlight that square. However, the way he did this was odd to me. He basically used the Floor pathway and a division and modulo to feign/approximate what index he wanted to select via the real-world grid locations. This method seems incredibly silly to me, as well as not compatible for non-square grids.

I’d like to know how take the “get hit result under cursor” pathway and directly modify the item it hits. I am aware I need to somehow work with arrays, but I’m a tad bit confused how would I go about that?

---

<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:** [August 2, 2020, 11:55am UTC](https://forums.unrealengine.com/t/how-do-i-use-get-hit-result-under-cursor-to-select-an-item-in-an-array/469056/2 "2020-08-02T11:55:19Z")

</div>

Like this:

 ![308916-levelbp.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/9/de90d9cf3a64535efa79728a03e6f26dee34fe3d.jpeg)

 ![308917-cubesbp.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/e/caeca3bd736152d15261cfa3e4b906b6402752bc.jpeg)  
308918-

---

<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:** [August 2, 2020, 11:57am UTC](https://forums.unrealengine.com/t/how-do-i-use-get-hit-result-under-cursor-to-select-an-item-in-an-array/469056/3 "2020-08-02T11:57:36Z")

</div>

![308920-findcomponent.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/2/2624ab33c08e4a8e0ebde3034eeb1caa616556b9.gif)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_27a1e58a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_27a1e58a](https://forums.unrealengine.com/u/anonymous_user_27a1e58a)\
**Post date:** [August 7, 2020, 2:51am UTC](https://forums.unrealengine.com/t/how-do-i-use-get-hit-result-under-cursor-to-select-an-item-in-an-array/469056/4 "2020-08-07T02:51:03Z")

</div>

TY! This is great!

---

<div class="post-metadata">

**Author:** ![Naira\_Fam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Naira\_Fam](https://forums.unrealengine.com/u/Naira_Fam)\
**Post date:** [March 24, 2026, 4:25pm UTC](https://forums.unrealengine.com/t/how-do-i-use-get-hit-result-under-cursor-to-select-an-item-in-an-array/469056/5 "2026-03-24T16:25:33Z")

</div>

Hi, if you’re looking to save time on your chess game, or avoid tutorial hell, check out this free chess game creator for unreal engine [https://www.youtube.com/watch?v=EDucHfBbvSY](https://www.youtube.com/watch?v=EDucHfBbvSY)

It includes mouse hit detection on board squares and more
