Give specific controller to a specific pawn dynamically ?
I have to create an asymmetric game in blueprint. I got 2 different pawns spawning in each level. Each pawn has to have a specific controller because we need different views, controls and characters. So, spawnActor is the answer to spawn a pawn I assume, but as it is a multiplayer game, we're going threw onPostLogin function belonging to our gameMode. OnPostLogin is giving us a playerController ( the default one I think ). How can I change this one dynamically ? Why can't I cast It into my specific player controller ?
Apologize about my english, kind regards. Yaël.
asked Mar 05 '17 at 11:42 PM in Blueprint Scripting
The first and simple suggestion would be, try to fit everything you need in the same player controller class and just give them different Pawns.
If that does not work, you need to dive into c++ and create a custom GameMode class. Then override "SpawnPlayerController(...)" or even better "Login(...)" . There you can spawn a specific PlayerController. It helps to take a look at the code in GameMode.cpp to see how it is done, you probably can copy most of the code.
answered Mar 06 '17 at 12:45 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here