[Closed] Control multiple pawns
I'm trying to figure out how to control multiple pawns within the game.
So what I want to do is, I want to start playing with a character in 3rd person view. While running through the level I want to be able to "enter" another pawn, things like a vehicle or something. So spawning a new pawn woundn't be an option, since the pawn already exists within the level.
I just could control the input with one playerController, which doesn't seem as "clean" to me. Since I would have to do alot of "switch / case" staements to figure out which pawn I'm actually controlling and what to do next.
My idea is to implement a playercontroller for every pawn. What I would have to do then, is to "posses" the pawn with the respective controller, which is quite easy, and I would have to hook up the new playercontroller. Exactly this is my problem. How would I declare that new playercontroller as the active one?
Or is there another way to implement what I want to do?
Thanks in advance.
The question has been closed Jul 11 '15 at 08:21 AM by Edregol for the following reason:
The question is answered, right answer was accepted
Hey, I think this is a logic problem. There's no need to switch controllers, that would make things much more complicated!? Why not make an interaction sphere component for the character, and identify/store whats in range of the character?
answered Aug 23 '14 at 07:25 PM
Why don't you just put all of the input parameters inside each pawn class, then you have one player controller per player, and the player controller posses each pawn, which will have all of the inputs for that pawn stored inside the pawn class itself. That is how I did it, I had player controllers switch pawns over the network too.
I'm not sure why you are putting the pawn specific controls inside the playercontroller
Follow this question
Once you sign in you will be able to subscribe for any updates here