GetOwner fail in construction script

I have a blueprint implementing a Character.
I need to change the Controller class in construction script.
The GetOwner function always return null in construction script.
15427-
How can I get the the object class in the construction script ?

Txs for your help.
Dom

From what i know, owner of Actor only determine at run time. For controller class, GameMode blueprint already allow u to change that.

ok, thank you.

Is there a way to change the controller class, coming from a public var defined within the BP, with the construction script. It is an AI, and I would like to be able to set a different AI controller in derived BP.

Dom.

Anything Pawn that are not control by PlayerController will be control by AIController, the only different between AI Pawns is not controller but BehaviorTree, u can assign different BehaviorTree on each AI Pawn if you want.

Why you need to change controller class in construct script and why you need owner for that? there actully more raliable way to get contoller using “Get Controller” node

but as Duncan said things are not initiated yet in constructor, you might alternaticly consider Begin Play event

After reading all your answers, thank you very much, I think I’m taking the wrong approach.
I explained what I would like to acheive.

I have a C++ class named AKIACharacter implementing a ACharacter.
This class is the base for all AI (boot).
I have also a C++ class named AKIACharacterController implementing a AAIController.

For all boots, I have a BluePrint called BP_IA based on AKIACharacter. In this BP, on the components side, the character mesh isn’t set. For each bot, I have a specific blueprint based on BP_IA. In this one, I assign the correct character mesh and its associated animation bp. This works fine.

Now I would like to set behavior to bot. Imagine I have two different bots. Bot1 and Bot2 to simplify. Therefore, I have BP_Bot1 and BP_Bot2. Both bp are derived from BP_IA. If I drag the bots in the level, no problem, they are there and use functionalities implemented in BP_IA.

As I read, and you explained, I have to use BehaviorTree. Let’s image I make two different behaviour. One is following the player and the other is running from one point to another.
In the tutorial I’ve seen in unreal web site, we have to create a blueprint controller. And in this blueprint we assign the BehaviorTree. That means, if I understand well, I have to create two BP controller. One based on the following BehaviorTree and the other on the running BehaviorTree.

Therefore I took the approach of creating a public var, based on AIController, in my BP_IA. Then, for each Boot I will be able to choose, from the editor, the right controller for him. But I might be wrong, and I might create a public var for assigning the BehaviorTree.

What do you think ?

Have a nice day,
Dom

You need to make you ai controller posses the pawn, either by setting AIControllerClass in Pawn/Character defaults

Or manually spawn controller and make it posses the pawn. Then you can contact controller from pawn via get controller and use behivor tree (thru i never played with it)

Ok. I think I understood. I’ll. try this way.
In the meantime, I’ve analyzed the ShooterGame sample. They are using the way you described.

Thank you very much for taking time to answer my question.
Have a nice day,
D.