How to make enemies not shoot each other

Hello all,

I am playing around with the shooter sample game to just learn and hey shoot stuff at the same time. I was messing around with the bots and I was going to make the demo level a sample single player demo. So i put multiple bots in and began the game. I noticed they all started shooting each other and realized they are set in a pure multiplayer mode. So i opened the code and blue prints and from the looks of it they appear to attack any pawn in the game. I was trying to figure out how to set there factions (like CryEngine 3 where i am coming from) and found out thats not built in. So i turned to blueprint to save me and for the life of me i cannot figure out how to set there enemy only = to the player. I tried adding the pawn sensing component and only set it to player but that did not work. Also how to stop them from just continuously respawing. If anyone can help me with this would be a great help. For a recap what I am exactly trying to do is set up some simple AI based off the existing bot AI in the shooter sample game that is not purely multiplayer. I want them to not shoot each other and also not continuously respawn.

Thank You Unreal Community

enter code hereYou can make collision channels for things. I found out about them when i had the same issue as you

Go to Edit ->project settings ->Collision(under Engine) → Object Channels->New Object Channel

Create a channel name like Enemy and another one for Ally

After you create your 2 channels:

In your BP with your collision object selected, change your Collision Presets to custom
And in the drop down collision menu, set “Collision Enabled” and your Object Type should be set to either enemy if it’s an enemy and ally is it’s an ally ect Make sure everything is set to block(if that’s what you want)except for it’s own Object type.

For example. Enemies should “ignore” other enemies, but block allies. You also put your enemy projectiles under enemy.

This only issue with this set up is that enemy and ally projectiles hit each other(unless that’s what you want). You would want to set up enemy bullets and ally bullets channels too.

If you want only a certain object to destroy you you would do something like

void AMyPawn::OnHit(AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{


	if (OtherActor->IsA(AEnemyPawn::StaticClass()))
	{
		Destroy();
	}



}

I have not really messed with the Shooter project so I can’t say much about the spawning