Timing when Actor Possess to AIController

I am studying C++ by following the examples in the book.
book version is 4.26 but i am using 5.3 version


In BeginPlay, AIController is null
But PlayerController is not null

ABCHECK is a macro that displays a log when false


Designating AIController in the constructor code

I even confirmed that it was created in the World Outliner

Is the timing of an Actor being possessed by an AIController different in Unreal 5?
Or is there something I made a separate mistake?

this actor also acts as a playable character and NPC.

image

Hey @smoothmooth ,

Are you sure that AIController ever possesses your ACharacter?

There is a chance that ACharacter is not possessed yet during its BeginPlay but that really depends on how you’re possessing it. Could you share something more about your setup?

Also, if this is a problem with timing, you can always use ACharacter:PossessedBy instead of BeginPlay

thank you for your advice
i solved the problem
I was missing
Super::OnPossess(InPawn);
in my AIController code.

it was my mistake

1 Like

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