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?