Hey guys, so I’m making a grid based game that is turn based. My problem arises when selecting a character to move. Basically, what i ideally want to happen is that the movement grid pops up and you can choose to walk to wherever, but when i tried to edit my code to allow the player to select the same spot the character started on and not move that character/begin actions instead of moving, the input gets messed up. Basically, input.getbuttondown is lasting too long and carrying over so when i select a character it automatically thinks im clicking it again and wanting to stay at the same spot. Anyone have this problem/know anyone who’s worked around this sort of thing? Thanks in advance for the help and if my description is confusing, please lmk
I would just add some kind of selection boolean. So run two checks, once to check if the player selects a character using getbuttondown and checking if ‘isSelected’ is false. Then for the first line of the getbuttondown set isSelected to true. Then have a second getbuttondown checking for isSelected to be true, and stuff your movement logic into this. This will make it so you have to click the player to select them, then click again to move them.
You should use GetButtonUp for selecting, instead of Down.
Thanks unitynoob but that is kinda what I’ve been doing and it just runs through the function too fast. Wow, Stardog that is a great idea, im an idiot lol