Associating a pawn with a player controller.
Hello, I was curious on how to go about creating or associating a pawn with a corresponding player controller. Should I create a "pawn" instance within the constructor of the PlayerController or should I create two separate classes, one being the PlayerController and the other being the pawn. According to the documentation on PlayerController, You definitely want some functionality in the PlayerController as opposed to the pawn, such as in a death match scenario.
I was wondering how to go about setting this up, for I want to be able to give commands to the Pawn through the player controller, and save data such as "score" in the PlayerContoller as opposed to the pawn, for I want that information to save.
Any direction would be much appreciated, Thanks!
asked Nov 07 '15 at 05:53 PM in C++ Programming
Whenever you are controlling a character or pawn at runtime, you can think of the character or pawn as a puppet and the player controller as the strings. Pawns that are being controlled are possessed by a PlayerController. In this sense, the PlayerController is linked to the pawn. You can easily store any information you like in the PlayerController and base events off the values listed there rather than looking at the Pawn's values. An example would be destroying the possessed Pawn when the PlayerController's health value reaches 0. It can be then be reset to max after 5 seconds, respawn the Pawn, and possess the Pawn.
Hope this helps!
answered Nov 09 '15 at 06:42 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here