Select Individual Children

I’m doing a top-down game, where the player can have one or multiple characters he can control. The player needs to select the character and then click on the ground to make it move, and this works fine with one character, but as I’ve said he can have multiple characters during the game, and he needs individualy select wich one he wants to move. Currently that’s not what’s happening, I’m making Child blueprints of my main character blueprint, but I can only move them once I’ve selected all of them, how can I fix this?

Basically I have a main Player blueprint as the default pawn that has only the camera and a spring arm, and this is the setup I’ve made to Posess and move the character if It’s selected (the character blueprint also have a camera, so the player can move even If It’s selected), and as I’ve said It works fine with one character, but when I put two or more childs in the map I can only move if I’ve selected them all, and It only moves one of them. It’s my first unreal project so I’m not sure what could be the best approach to this problem.

That code you have there does look a bit dodgy. I can follow your logic, but… also don’t know what else is going on :wink:

You don’t need to loop over everything. You can use a dispatcher.

When you click a character, you can fire a ‘unselect all’ dispatcher, and this character knows to mark itself as selected, because you clicked it.

When you click the ground, you can run a ‘move’ dispatcher. Only the character that’s selected will respond ( that’s how you code it ).

You’ll need an actor in the scene for them all to bind to, which dispatches the instructions.