Hi! Would sb explain how to change a game mode eg. from Third Person in the same level on trigger via Blueprint?
Best!
Hi! Would sb explain how to change a game mode eg. from Third Person in the same level on trigger via Blueprint?
Best!
can you elaborate on what you mean by “GameMode” because I feel there is a disconnect between what the engine considers a “GameMode” and what you are conceiving of.
from “Third Person” too what?
in most games “Game Mode” is the some total of the rules, logic, and assumptions of your game. for example changing from say a Third Person Action Brawler to a First Person Puzzle spot the object thing (like say the Batman Arkhem Series). these can be done in the same “Game Mode” either through swapping controllers, and Player Pawn, or just by using state based flags in the Controller, or Player Pawn
when it Comes to Unreal the GameMode is loaded very early in the process of loading a level, and has a lot of interlinking with other systems, to where the only tangible way to change GameMode is to Load a Different level, while flushing the current one, and this is true even for C++.
To the potentially more interesting part of your question, and the what you are “probably” trying to achieve:
the key differences between say a First Person Action Brawler, and a First Person Puzzle spot the object game: is the position of the camera relative to the controlled Pawn, and what the inputs do. besides swapping the Visual Interface which is trivial.
for example if there are only ever going to be 2 states then this could be a bool, and if there are going to be more then 2 an Enumeration.
then in each of the pertinent classes have different logic depending on what “mode” the game is in; with an Event for the transition (sets the new state and manages things like switching the Visual Interface, camera relative Position or connection, and changing other state based variables.
then in each of your input_Event() you put in a switch block based on that state variable, and go from there.
though if each of your GameModeStates are fundamentally different you could swap the InputMappingContext, and have different Events for the different InputMappingContext. If you are not using EnhancedInput then you might have to live with the increase in spaghetti of Switch nodes.