I have a character that can work both as an aircraft and a player character. Fully functional behaivor tree.
Would there be a way for me to check if the character is possessed by an aircraft controller or a player controller? Because I want it to only run the behaivor tree if its not possessed by a player.
More technical details.
I needed to make a pawn for all controllers to be able to use. But I’m making something kind of like an “rts” type game. Each player has a normal pawn for camera movement but a separate pawn spawns and is assigned to them. (I did this because I couldn’t run an EQS query while a player possessed the pawn. I want to make it so if the unit is not assigned to a player’s pawn then it will run that behaivor tree. Otherwise not.
Don’t know if you’re still looking for an answer, but came across your question when I was looking for similar. Here is how to determine if character is player or ai controlled:
void AThirdPersonCharacter::BeginPlay()
{
// Call the base class
Super::BeginPlay();
// determine if this is player or ai controlled
if (Cast<APlayerController>(GetController())) {
IsAIControlled = false;
} else {
IsAIControlled = true;
}
}
I did try that and it did work. but what I ended up doing was making a player character that was basically just a camera with RTS camera like movement and assigned 1 pawn to the player’s character and wherever I clicked it would send a message to move to the location of the click whils still being able to run the behavior tree to execute the EQS query