Download

C++ AI - should I use an actor or what?

I’m really new sorry.

I made a blueprint called “Ufo”. This contains a static mesh that looks like a ufo and 4 physics thrusters, all pointing down, whose thrust value I made as variables.

It works great, and it flies around.

I now want to make a C++ class that will fly the Ufo (It’s an NPC). It will take the current position, yaw, pitch and roll and output the required thrust for the four thrusters.

But how should I do this conceptually? Should I have an custom actor with a subobject pointer to the Ufo? Should I use the behavioural classes? Should I use a controller?

And how do I even reference my blueprint from c++?

Thank you very much.

Maybe you should create your c++ class first then derive the blueprint from it.

You can reference the blueprint using the FObjectFinder, i.e:
static ConstructorHelpers::FObjectFinder<UBlueprint> PlayerPawnObject(TEXT(“Blueprint’/Game/Blueprints/BP_Character.BP_Character’”));

Sorry for my poorly written english. Its not my native language.