Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Spectator camera not setup like current view target

Description: In multiplayer (with dedicated server) game, spectator camera not setup like current view target when player controller got to spectating state.

Steps for reproduce: I've prepared simple test "Third Person" project to illustrate this issue. Please download project by link below and run with "Run dedicated server" checkbox enabled, after that walk around on level, change camera view by mouse and press "1" on keyboard. You should see that spectator camera not setup as expected, but setup player controller camera.

Interesting method is "SwitchToSpectator" in character class.

Notes: I assume that this issue in SetPawn method, because this method called when pawn replicated from the server to client and after that setup current view target to current player controller (because this pawn will be NULL) in methods AutoManageActiveCameraTarget

Sample project link: project

Product Version: UE 4.15
more ▼

asked Apr 07 '17 at 11:42 AM in Bug Reports

avatar image

1 3 4 5

avatar image Sean L ♦♦ STAFF Apr 11 '17 at 03:06 PM

Hey asherstnev,

What are your expected results with this setup? What are you trying to achieve overall?

avatar image asherstnev Apr 11 '17 at 04:35 PM

Hey Sean,

The expected result should be set active camera/location/rotation from spectator and not from player controller. Also switching(pawn -> spectator) behavior is different when run game with/without dedicated server option enabled

I'm using the next dirty fix in SetPawn because in this method the first condition set up active camera target to player controller and not to spectator

 void ASPlayerController::SetPawn(APawn* InPawn)
     if (InPawn == nullptr && GetStateName() != NAME_Spectating)
         const FVector NewLocation = (PlayerCameraManager != nullptr) ? PlayerCameraManager->GetCameraLocation() : GetSpawnLocation();
         if (bAutoManageActiveCameraTarget)
     if (GetPawn() && bCinematicMode && bHidePawnInCinematicMode)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Thanks for the clarification, I've reproduced your issue and entered a bug report, which you can track using the link below:


Thank you for your report.

Have a great day

more ▼

answered Apr 12 '17 at 06:45 PM

avatar image

Sean L ♦♦ STAFF
43.5k 485 152 442

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question