TL/DR: I want to make it so that when I select a tile it becomes highlighted, and then when I select another tile it un-highlights the previously selected tile and said ‘another’ tile becomes highlighted instead. Can’t figure it out for the life of me.
Hey everyone, I’m fairly new to Unreal and only just barely working things out.
So long story short I’m working on a top-down tile based game, where the player controls a character via the tiles on a playing board. I have set it up so that when the mouse hovers over a tile it highlights it by changing it’s material, this is working all fine. But now I’ve created a select function using Event ActorOnClicked, which again works fine. When I click on a tile it toggles the material, showing it’s being selected and deselected. However, I want it so that when you select one tile and then select another the previous tile will automatically be deselected. For example, when the player clicks Tile A it turns orange. When the player then selects Tile B it turns orange and any other tile(s) that were previously selected turns white. That’s the kind of thing I want, but I can’t figure it out. Any help would be amazing, thanks.
This is the blueprint I have made so far if it’s any help.