Character + Broadcast Screen
Live inside a 3D world: in CharacterBroadcastDemo any player can go live on a screen in the world, and everyone else watches it there — with the sound coming from the screen.
01
Run it#
- Needs Starter Assets and Cinemachine (like the Character demo), and the Character Definition's server code deployed (it includes Live).
- Open
Examples/Live/Scenes/CharacterBroadcastDemo.unity, run two copies, connect both. - In one, press B to go live. [1] plays the built-in test video, [3] the next video, [2] your webcam, [0] off air, [B] stop.
- The other player sees and hears it on the screen; walk closer for louder sound.
02
How it is built#
The BroadcastScreen object holds NetCrafterLiveBroadcast (Viewer Audio Spatial Blend 0.8, so the sound comes from the screen) and LiveBroadcastScreen, which:
- draws the video / webcam into one RenderTexture that the broadcast sends (
video = RenderTexture); - sends the video's sound with
SetOutgoingAudioSourceinstead of the microphone; - shows that texture on the screen locally, and
RemoteVideoon viewers' screens; - watches whoever goes live automatically, and refuses a second broadcaster while someone is live.
03
Your own videos#
No video is included — the Asset Store does not allow video files in packages. Until you add one, the screen shows “No videos” (the webcam and off-air modes work straight away). Any short .mp4 or .webm will do for testing.
Assign a videoClip, set videoUrl (file or http(s)), or drop files (.mp4 .webm .mov .m4v) and/or a urls.txt into StreamingAssets/BroadcastVideos — they are picked up without rebuilding.