Announcement

Collapse
No announcement yet.

Why do clients not auto activate Camera (ACameraActor)?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Why do clients not auto activate Camera (ACameraActor)?

    In my player controller's BeginPlay, I check whether the player may activate any "view targets" by adding:
    Code:
    for (auto iter = GetWorld()->GetAutoActivateCameraIterator(); iter; ++iter)
    However, the iterator is always empty for every connected client. The listen server (host) will find the ACameraActor instance. GetAutoActivatePlayerIndex returns the correct index btw. Due to the failure to activate a camera actor, it defaults to the pawn.

    I have placed 1 ACameraActor in the level, and set auto activate to player0. Every local player should yield the 0 index.


    Iterating by class finds the instances just fine:
    Code:
    for (TActorIterator<ACameraActor> iter(GetWorld()); iter; ++iter)
    Here's the output from the hosting client (listen server):
    Code:
    actor iterator found camera: CameraActor, PlayerIndex: 0, Local=FALSE
    actor iterator found camera: CameraActor_0, PlayerIndex: -1, Local=FALSE
    actor iterator found camera: CameraActor_1, PlayerIndex: -1, Local=FALSE
    GetAutoActivateCameraForPlayer invalid!
    And here's the client's log (connected client, tested locally):
    Code:
    actor iterator found camera: CameraActor, PlayerIndex: 0, Local=TRUE
    actor iterator found camera: CameraActor_0, PlayerIndex: -1, Local=TRUE
    actor iterator found camera: CameraActor_1, PlayerIndex: -1, Local=TRUE
    GetAutoActivateCameraForPlayer invalid!
    The PlayerIndex is retrieved by calling ACameraActor::GetAutoActivatePlayerIndex(), described as:
    Code:
    /** Returns index of the player for whom we auto-activate, or INDEX_NONE (-1) if disabled. */.


    I made sure the ACameraActor instance had NetLoad set to TRUE. Though it probably isn't a replication issue, as the instances are found.

    Any suggestion is much appreciated!



    PS related post on answer hub https://answers.unrealengine.com/que...cameraact.html
    Last edited by Byrkoet; 06-11-2019, 01:38 AM.

    #2
    AFAIK auto activation is not meant to be used for networked multiplayer. The player index refers to local (aka: multiple gamepads) players, not remote clients. On a dedicated server calling GetPlayerController(0) should return nothing.

    Comment


      #3
      Originally posted by Manoel.Neto View Post
      AFAIK auto activation is not meant to be used for networked multiplayer. The player index refers to local (aka: multiple gamepads) players, not remote clients. On a dedicated server calling GetPlayerController(0) should return nothing.
      Auto activation was set to player0, which there's always one of on a client - even a listen server.

      I mentioned it concerns a listen server.
      Also post starts with
      In my player controller's BeginPlay
      .

      Comment

      Working...
      X