Download

Confused about UE4 Gameplay framework.

Going to just list my questions. To give context, my game is a game with a hex grid and a player occupying a space on the grid. The camera is like the strategy game camera. Moves are chosen via the HUD, and then carried out on the board.

  1. Providing a camera that is similar to the strategy camera seems to require a “Pawn”. Even though really all this Pawn is doing is allowing the player to move the camera. I tried getting the player controller (player controller 0) to have a camera component, but i couldnt see how to set this camera as “the camera” from the camera manager.
    My question, why does SetViewTargetWithBlend require a camera actor and not a camera component? A camera component by definition is wrapped by an actor and has a transform, why does it need to have it’s own unique transform? Because of this i was unable to have the camera component in the player controller be used as the viewing camera.

  2. Can someone give a clear definition of the Player Index? In one case with pawn’s AutoPossess enum, Player number seemed to represent networked players (as changing that enum effected what client had a working camera). I read on answer hub somewhere however, that it was used for locally connected players only (like split screen type stuff).

  3. Can someone also give a clear definition of “View Target” mentioned in the docs? Is it a) the thing you are looking at. or b) the camera to be set. ??

  4. Is there an equivalent to Camera.Main from unity? how can i set this camera at runtime?

If number 1 is true and a pawn really is required, then that means i have 2 pawns per player. A spectator ish pawn for moving the camera around, and then the pawn that represents the player on the board. Technically, i think that the pawn on the board could just be an actor, but it seems like it should be a pawn because it is specifically owned by a player. What i ended up doing was setting the pawn on the board as the default pawn, and then on BeginPlay just spawn the other spectator pawn and have the player controller posses it. But this is where 2) comes in, the local player DOESNT possess that pawn. only 1 client or the server manages to get one of these spectator pawns when i instantiate it that way.

And this is why i am confused!

These are good questions, you should split them into individual ones and post them on Answerhub.

If you start with one of the templates like the Strategy Game it puts some framework in for you. If you’d like it different it’s better not to fight it but just start with a blank project. It’s your choice where you put different things if you go farther up and use base classes and Actors. There would be nothing wrong with having 2 pawns if that’s what is convenient for you for functionality.

I have the default pawn set to be the spectator pawn, and then it still uses the player start for placement. I think if you just need that for the camera, the spectator pawn is what you are looking for. Then yes, any playing pieces on the board may be other pawns, or characters/actors depending on what type of functionality you want built in.

Thanks,

It sounds like I am on the right track in terms of pawns, which is a relief. I just need to really figure out this camera system, it is quite a bit more involved than unity’s which I have built on top of myself. So the Blending of cameras makes sense to me, how the manager fits in, the docs on it don’t seem to work for me.