#unreal

Function used to determine the attitude (hostile/friendly/neutral) of two teams for Perception Detection by Affiliation

By default every team is hostile against every other team. To specify which team an actor belongs to, you need to use IGenericTeamAgentInterface.

Usage

Call FGenericTeamId::SetAttitudeSolver with a function that matches FAttitudeSolverFunction. This function should compare the two teams given, and return what the attitude between the teams is. You can set this up for example in a subsystem or your gamemode class.

The easiest way to use this is to use a Custom TeamID enum.

Then, in the attitude solver function you can do…

if(Of.GetId() == static_cast<uint8>(EMyTeamId::TeamA)) {
	return ETeamAttitude::Hostile;
}

This would return hostile if Of is the team TeamA.