Possessing Pawns in Blueprint

Illustrates using the Possess node in Blueprints to switch between and control multiple characters.

On this page

Learn how to use the Possess and UnPossess Blueprint nodes to take control of and provide input to a Pawn or Character in your project.

For the purposes of this guide we are using the Blueprint Side Scroller template, however you can use your own project if you would like. If you do not know how to create projects or use templates, refer to the Project Browser page for more information.


  1. From the Content Browser, drag-and-drop into your level the additional characters you would like to control.


    Here we added two additional SideScrollerCharacter Blueprints from the Content > SideScrollerBP > Blueprints folder to the level giving us a total of three characters in our level. With this particular template project, a character is already placed inside the level by default.

  2. In the World Outliner, select each of the characters you want to control.


  3. From the Main Toolbar, click the Blueprints button and Open Level Blueprint.


  4. Right-click in the graph area, then select Create References to selected Actors option from the context menu.


    This will allow us to reference each of the characters that we've selected in the level.

  5. Right-click in the graph area, then search for the 1 Keyboard Event and select it.


    This will allow us to fire off an event whenever the 1 key is pressed or released.

  6. Add the 2 and 3 Keyboard Events to the graph.

  7. Right-click in the graph and search for and add the Get Player Controller node.


    The Player Controller is used to take the input from a human player and translate that into actions for a Pawn.

  8. Left-click and drag off the Return Value of the Get Player Controller node and search for and add the Possess node.


    This will tell the Player Controller which target Pawn to possess and take control of. When the Possess function is called, it will automatically check if a Pawn is currently controlled and UnPossess it first before attempting to Possess a new Pawn.

    You can use the UnPossess function if you want to have the player release control of their Pawn and enter, say for example, a spectator type of state where they are not directly controlling a playable character.

  9. Create two more Possess nodes and connect the 1, 2 and 3 Keyboard Events as shown below.


    We are now set up to possess a Pawn when 1, 2 or 3 is pressed. Next we need to define which Pawn to possess from our references.

  10. Connect each of the SideScrollerCharacter references to each of the In Pawn pins as shown below.


    Our scripted functionality is complete and we are ready to test it.

  11. Click Compile from the toolbar to update your script.


  12. Click Play from the toolbar to play the game in the editor.


End Result

When you press 1, 2 or 3 on your keyboard you will switch between each of the characters in your level.

Выбрать тему

Добро пожаловать на новый сайт документации Unreal Engine 4!

Мы работаем над множеством новых функций, включая систему обратной связи, чтобы вы могли рассказать нам, о том, что мы делаем. Этот вариант не совсем готов для использования в конечном релизе, поэтому перейдите на форум обратной связи по документации, чтобы рассказать нам о проблемах с этой страницей или написать нам о любых проблемах, с которыми вы сталкиваетесь в работе с документацией.

Мы обязательно сообщим вам, когда новая система будет запущена.

Отправить отзыв