How to grab the chair

I think i would use inheritance to look at the item i would like to grab.
Say GetWorld()->ActiveGroupActors()
which would return an array with all the active actors in the scene and then i would iterate through them finding the label and comparing to “SM_Chair”, something like:

AActor *actors[] = GetWorld()->ActiveGroupActors();

for( int i = 0 ; i < sizeof( actors ) ; i++ )
{
    if(actors[i]->GetActorLabel() == "SM_Chair")
    {
         //get this chair and move it
    }
}

I haven’t tested this code, i think it should work but it would be resource intensive because of the iterations through the actors in a big scene.

Privacy & Terms