First person spectator camera
I'm doing a project for school, and I am struggling with blueprints. What I want to achieve with networking is, while someone is playing a FPS character as the server, every client which are connecting to the server spawn as a first person spectator camera seeing what the server player is doing.
I would use this setup for a VR Showcase, in order to allow the audience to see what the VR player is doing in game.
I guess it's easily doable but I'm a noob with BPs, and I could not figure it out. Even after reading the documentation and exploring First Person Shooter example and UT BPs.
Some assistance would be greatly appreciated !
asked Mar 24 '15 at 02:49 PM in Blueprint Scripting
I needed similar thing and managed to find a solution.
It turns out, that UE4 has spectator functionality built-in. It's just not properly documented and advertised.
There's a set of functions that allows you to cycle through players if you are curently spectating.
I'm attaching the project that has this figured out. I've tried it on GearVR and PC. GearVR was acting as a server (so that spectating functionality is optional).
By default the game loads an entry map, that immediately chainloads another map but with
Next, you can connect from PC with another instance of the game:
Replace path and ip accordingly. The
After you connect, press PageUp and PageDown to cycle through players, and Home to go back to free flight camera (in this example it's quite limited becuase it's set up for mobile controls).
Relevant logic (not much of it) is implemented in
Effectively, spectator functionality is implemeted as changing the view target in PlayerController/PlayerCameraManager (
If you have more questions, feel free to ask.
Link to example: https://www.dropbox.com/s/po8hqbmni20lnir/NetTest.zip?dl=0
Ok, the best way I think would be to start all players with spectator pawns and let the server one switch to a playable character later on. It is also possible to set up spectator/player classes properly as in a regular competitive FPS, but no need for it right now.
Start with the Default Pawn (it comes with the engine and is set by default if you ) set as your character in the Game Mode. Then spawn a playable character from the server blueprint (you can put a has authority switch to check if it's indeed the server) and get your player controller to possess it.
answered Mar 25 '15 at 11:38 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here