I’m working on a project which makes use of multiple pawns. The logic which drives their movement is being held in the player controller.
Problem is: when a pawn is killed to transition to another, the controller movement functions still look for their target and an error is returned. “Accessed None”
I use a branch to disable the input to the function, but the function still looks for a valid target, even if it is not receiving input. What approach is best to keep the functions happy when not in use?
IsValid with bool is just an alternative to the input one as far as i know, so you can use either one of them. IsValid checks if the object exists in the game or not so it prevents any kind of errors you may have when you try to send input to a destroyed/not yet spawned object.