session
Local players, LAN sessions, host and join, split-screen, and voice chat.
What it's for
This namespace drives the runtime side of local and LAN multiplayer from the editor: adding and removing local players on the active game instance, configuring LAN session settings, hosting a LAN server on a map, and pointing a client at one to join. Each operation acts on the live game instance, so the effects show up in Play-In-Editor or a launched session.
It also covers the couch-and-comms details you need for local play: split-screen layout, plus voice chat and its supporting controls — enabling voice, tuning audio settings, push-to-talk, proximity attenuation, channel selection, and muting a specific player.
Reach for session when you want to stand up or exercise a local multiplayer setup
without leaving your assistant, for example spinning up a host and a second local player to test
split-screen. It is the runtime session layer; if instead you need Blueprint replication, RPCs,
actor ownership, prediction, or authority checks, use networking.
Examples
Host a LAN server on a map
Ask your assistant to stand up a LAN host and travel to the map immediately.
You: Host a LAN server called "Test Arena" on ThirdPersonMap for up to 4 players and travel now.
call("session.host_lan_server", {serverName:"Test Arena", mapName:"ThirdPersonMap",
maxPlayers:4, executeTravel:true})
→ {ok:true, hosting:true}
Done. Hosting "Test Arena" on ThirdPersonMap; server travel started.
Add a second local player and split the screen
Bring in a second player on the local instance, then set up a horizontal split.
You: Add a second local player and turn on horizontal split-screen.
call("session.add_local_player", {controllerId:-1})
→ {ok:true, players:2}
call("session.configure_split_screen", {enabled:true, splitScreenType:"TwoPlayer_Horizontal"})
→ {ok:true}
Done. Second local player added; split-screen set to TwoPlayer_Horizontal.
Join a server and enable voice chat
Point the client at a host address, then turn on voice for the session.
You: Join the server at 192.168.1.20 and enable voice chat.
call("session.join_lan_server", {serverAddress:"192.168.1.20", serverPort:7777})
→ {ok:true, joining:true}
call("session.enable_voice_chat", {voiceEnabled:true})
→ {ok:true, voiceEnabled:true}
Done. Joining 192.168.1.20 with voice chat enabled.