Ramblings of General Geekery

UE5 Gameplay Cameras: Upgrading to 5.6

This is the eighth post in my developer diary for the Unreal Engine camera system. Since the UE 5.6 release has just gone out, I figured I would write a little bit about what to expect if you’re using the early UE 5.5 Gameplay Cameras experimental plugin.

While the GPC plugin is still flagged “experimental” and, therefore, we don’t guarantee any backwards compatibility for it, I made a reasonable effort to keep most things working. There are however a couple of breaking changes to prevent having to maintain cumbersome code in such an early stage of development. This article is most about that.

Asset Changes

The first visible change will happen when you open a Camera Asset in the editor. All of its Camera Rigs will be broken out into separate assets, and you’ll get prompted to save them. These Camera Rigs will get auto-named, and you can rename them afterwards if needed (there is a cool bulk-rename feature in the editor!)

I wrote about this change in this earlier article, along with the reason for it, and the pros and cons of the change. Since then I addressed, at least partially, some of the downsides (namely points 2 and 3 from that article).

There is a new “shortcut bar” in the top-right corner of the GPC asset editors which looks similar to the one from the animation editors. It lets you navigate from a Camera Asset to any of the Camera Rigs referenced by its Camera Director (addressing point 2), or from a Camera Rig to any Camera Asset that uses it (addressing point 3). For future development, I’m also keeping an eye on the “Workspace” concept that the recently announced Unreal Animation Framework uses.

The Camera System Actor is Deprecated

Gameplay Cameras Components now run their own camera system when they activate. This not only makes it easier to work with Camera Rigs in Sequencer, it also solves problems with the previous approach, which was to auto-spawn a Camera System Actor and set that as the view target.

This previous approach effectively tried to easily setup a “central” camera system without the hassle of changing the Player Controller and Player Camera Manager, but it turned out to be a bad idea.

Not only would it have required special tooling for Sequencer’s Camera Cut Track, it also caused some problems to set the view target to a different actor than what some of the rest of the engine expected. For instance, many developers are used to having the player pawn as the view target, and messing with that easily causes confusion and problems. It also breaks some engine features like the OwnerSee and OwnerNoSee properties, or some level streaming functionality.

The Camera System Actor still exists, but all the auto-spawning stuff is gone.

Gameplay Camera Component Activation

As mentioned above, the GPC components are now “standalone” in the sense that they run their own camera system when active. The default is for “Auto Activate” to be enabled, so any GPC component in a level starts running its logic from BeginPlay all through to EndPlay.

This may or may not be desirable: maybe you don’t want dozens of Camera Rigs running in the background, or maybe you have some Camera Director logic that does something on start, or whatever. In this case you’ll need to disable the Auto Activate option, and activate and deactivate these components manually, using the basic Actor Component API for that.

This is probably a more “Unreal” way of doing things anyway, but it’s a breaking change, so worth mentioning.

Note that in addition to the basic Activate and Deactivate methods, GPC components have other related methods for extra control: activation functions that associate running Camera Rigs with a given Player Controller for anything that requires knowing about that (player input, excluding the player pawn from ray-casts or collision, etc.), and a deactivation function that has a flag for letting any running Camera Rig(s) gracefully blend-out (instead of stopping everything immediately).

Extra note for those of you who copied the Game Animation Sample Project setup: if you have both a GPC component and a “vanilla” camera component on the same actor, it’s sort of undefined which component the engine will use if both are active. You’ll need to activate one and deactivate the other (and vice-versa), or turn off bFindCameraComponentWhenViewTarget and implement the actor’s CalcCamera() method by hand. That’s because when that flag is true (which it is by default), the default implementation of CalcCamera() is to find the first active camera component on the actor. So whether it finds the GPC or “vanilla” camera component first depends on how it’s ordered in the actor’s component tree.

Blueprint API Changes

You may see a few Blueprint methods being marked as deprecated in Blueprint Camera Directors and Blueprint Camera Node Evaluators. In all cases, there should be a message indicating what to use instead, and it’s generally pretty straightforward.

What happened here was that some of the Blueprint API wasn’t following the general “look and feel” of Blueprints, and so it had to be fixed to work the way Blueprints users would expect.

There were a lot of changes between UE 5.5 and 5.6 for the Gameplay Cameras plugin (and still more to come), but hopefully I managed to make most of them rather transparent… if not, feel free to ping me and I’ll do my best to provide some assistance. Until then, onwards to UE 5.7!