How would i switch Player Controller and HUD in game play? This should be simple.

How would I go about switching the player controller and HUD while in game by box trigger? I cannot figure out how to combine them all so this will be a quick fix until then.

Player controller 1 + HUD 1 = activation of inventory/HUD
Player controller 2 + HUD 2 = activation of weapons/vehicles

How would i activate player controller 2 and HUD 2 on trigger begin overlap, and go back to original controller and HUD on end overlap?
Please and thank you. I am so stuck on this and have been for moths!

You should detach your character prom player controller, spawn new player controller, possess character, spawn new HUD, and new player controller you use new HUD.

This sounds like something that would work.
Any links to tutorials on this? Thanks!

I tried to do that in blueprints and I don’t think that’s possible at the moment. Problem is that in blueprints you can’t spawn objects that are not inherited directly from UBObject. I can show you how to do that in c++ if you are interested.

to be honest i am a complete noob when it comes to C++. so it would probably take a while for me just to get the hang of it.
i guess ill just keep searching and playing around to combine the HUD and Player Controller with the other ones. thank you tho for responding to this post, it is actually quite rare that people comment back haha

You are misunderstanding the idea behind the player controller.

The player controller is set by your Game Mode and you are not supposed to change it routinely. Controllers are usually changed during loading when a new Game Mode is initialized. Example: main menu player controller transitions to multiplayer player controller when a player enters a multiplayer match, however this is done by loading a new game state and a new level. I am not saying that is impossible (I really don’t know) but I am sure that it is not recommended.

The player/ai controllers represent a useful abstraction for realizing the internal network architecture. Think of the controller objects as the place where input events originate from and player controllers are associated with a network connection in multiplayer games while the AI controllers are only run on the server.

The HUD is also set in the Game Mode which means that you have to put all your logic in the same HUD object.

In short:

  • Use UMG UI to change between inventory and weapons/vehicles in the same HUD in the same Player Controller;
  • Use the player controller just to send player input to the different possessed pawns like vehicle or character;
  • Handle how the player input is interpreted by the pawn or the active widget.

I am not sure I explained it well but do ask questions if anything is unclear.

yes how do you do this in c++.,yes show us how to do this in c++!!!