Hello Dear Collegues,
I have a small problem tat bugs me for days.
it sounds like this: If I select 1 character , no matters witch one, i can move that character, but if i select another character, this one does not move but is selected, if i switch to the first selected character this one i can move
It sounds like there might be an issue with Unpossessing the selected character and possessing the new character.
parts where you switch characters, namely after checking to see if Selected character is valid and then going on to unselect the selected character and select the new one for starters.
Calling Possess will implicitly call UnPossess for you since a controller can only possess one pawn at a time. I can’t spot anything wrong with it though other than the references might be incorrect. You should set a break-point and follow the flow when it breaks on the second character and see where the flow goes and if the references are correct. Also I assume this is a single player game since if it is multiplayer then Possess has to be called server-side.
The SelectedCharacter reference. Ensure that it actually is the 2nd character and not the 1st or something else. Also ensure that Possess only gets called once.
No ideea what is going on , i put print strings it does appear i select the character but i cant move it only , the first character that i move i can move again