This page shows how to hand an existing Humanoid from a player to an NPC controller and back during play. Control changes only on the authority: the server in multiplayer, or the only machine in standalone play. See Multiplayer and networking.
Transfer a Humanoid from player to NPC control
Use a test map with a configured Humanoid and game-owned logic to request the handoff.
- In standalone play or on the server, confirm Is Character Ready on the existing Humanoid. Spawn a free compatible AI controller, such as BP_HumanoidAIController from the SGF character content. If a controller already possesses a different pawn, deal with that pawn according to your game's rules before using the controller here.
- On the Humanoid, call Transfer Control with the AI controller and inspect the returned operation result. Check that Get Character Control Mode reports AI. The pawn keeps its character definition, abilities, inventory, equipment and appearance.
- Check Get Last AI Result on the AI controller after startup. The supplied controller starts in an idle state.
- To test movement, add a Nav Mesh Bounds Volume covering the walkable area. Once the controller is ready, call Move Character To on it with a reachable destination and inspect the operation result.
Hand the pawn back to the player
Call Transfer Control on the authority with the free player controller. Check that the control mode returns to Player, that input works, and that the item and appearance are still present.
Start a pawn under NPC control
For a pawn that should start under AI, set AI Controller Class and the appropriate inherited Auto Possess AI value in its Blueprint defaults. Use AI Asset Browser and AI Action Editor when replacing the idle behaviour with your own state configuration. In multiplayer, test the transition with the server as the authority.
See the handoff diagram. Advanced shows the same transfer in C++.
Optional: ask an AI coding assistant for help
If you use an AI coding assistant, give it one outcome, the map and asset paths, what works so far, and how you will check the change. First play the generated level so you have a result to compare with. For an error, add the relevant Output Log lines and the Unreal and SGF versions. Copy Reference in the Content Browser copies an asset's path.
For example, with the default Playable Starter names:
I used SGF's Playable Starter to make L_SetupTest. The pawn is
BP_PlayerCharacter, and the starter item is DA_PlayerCharacter_StarterItem.
I can move and switch views in Play in Editor.
Help me make the starter item begin equipped in Main hand. The item can
keep its current presentation.
Use my existing SGF project assets. Show me what to change in Unreal and
how to verify that the same item starts equipped when I play L_SetupTest.