Hi, I’m making a game where ai and players can fight right now. I got into trouble today while trying to make Potion.
I thought it would be nice if only the player overlapped with potion. So I created a profile for the player. I created a Trace channel for potion. ai used the Pawn Profile, which is basically provided.
I will show you some of the code I wrote and the profile and channel I set up.
The picture above is the Trace Channel of Potion.
The picture above is the profile that ai is using. I hope it doesn’t overlap with motion. So I did ignore it.
The above picture is a profile that is used.I created today.
AOLNPCBasic::AOLNPCBasic()
{
GetCapsuleComponent()->SetCollisionProfileName(TEXT("Pawn"));
}
AOLCharacterPlayer::AOLCharacterPlayer()
{
GetCapsuleComponent()->SetCollisionProfileName(TEXT("OLPlayer"));
}
AOLHPPotion::AOLHPPotion()
{
Trigger = CreateDefaultSubobject<UBoxComponent>(TEXT("BoxTrigger"));
Mesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"));
RootComponent = Trigger;
Mesh->SetupAttachment(Trigger);
Trigger->SetCollisionProfileName(TEXT("OLHPPotion"));
Mesh->SetCollisionProfileName(TEXT("NoCollision"));
}
I wrote the code like this. And I don’t think that’s how you set up your channel. I was curious about the name of the set channel, so I printed out the log and the channel name of your trigger was Custom.
What’s wrong with the code above that the ai suddenly won’t move? When you play it, the action tree will move normally..