Hi all. I am trying to learn UE while setting a playable archeological reconstruction.
The player should be able to wander either within and outside a building, experiencing how it was originally done.
What i would love to implement tho, is giving the chance to “take flight” in order to move closer to unreachable details such as high ceilings and details.
I have managed to setup a standard First Person mapping and attached it to a character, and thought that i could setup another mapping to be attached to an alternative pawn that could move with the main character and that i could switch to by pressing a key. Still don’t know how to do it but i guess i could manage to figure out how.
Was just wondering if you could suggest a better/more effective/smarter way to achieve this behaviour.
Thanks in advance for any feedback!
You don’t need to change the game mode in runtime (in fact, I suppose, it is not possible). You can manage the current pawn in PlayerController - PlayerController | Unreal Engine Documentation
You can keep track of both pawns in the player controller. Suppose you want to switch to the ‘flying’ pawn. You need to unpossess your current ‘standard’ pawn (and hide it if you need to) and then possess the ‘flying’ pawn (optionally unhide).
Speaking of input, you can also keep track of it in the player controller. Just send it to the current pawn and process it separately in the respective classes.
Thanks a lot for your answer and sorry for not having replied earlier, i just got the notification.
In the meantime i found a very simple way to accomplish the task, even if maybe not very elegant (enough for early testing) I have mapped a “Fly” InputAction (secondary mouse button) that while pressed switches the movement mode for the main pawn from “walk” to “fly”. When released it switches to “falling” that as far as i’ve tested basically reintroduces gravity making the pawn moving as in “walk” mode
But for the definitive version i’ll surely go for your suggestion since rather than letting the player itself to fly, it’s better to let him carry a drone pawn that he could release when needed!