Building Escape: How to get the trigger volume to only accept specific actors?

Apologies if this is a basic question. I managed to solve the mass challenge so that I get a door to open if I put actors of a specific mass inside of my trigger volume. I wanted to now challenge myself further by getting the trigger volume to accept specific items (like a cone shape for example). I thought that I got somewhere by assigning tags to my objects, but I still can’t get them to work. Would anyone have an idea if I’m on the right track?

I assigned a tag to a cone shape (I called it WIN) in the editor, and I’m not sure if I’m supposed to write it in the cpp or header of my door.

	CheckTag = AActor *->ActorHasTag(WIN);

	for (AActor* Actor : OverlappingActors)
	{
		if (CheckTag = true)
		{
                 OpenDoor(DeltaTime);
		}

The check needs to be in the loop. Also CheckTag = true is an assignment not a comparison.

for (AActor* Actor : OverlappingActors)
{
    if (AActor->ActorHasTag(YourTagHere))
    {
        OpenDoor(DeltaTime);
    }
}

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms