Skip to main content

Migration from Game Components

The camera components that shipped with Game Components 1.x now live in the Gameplay Cameras package. Their type names and saved data are unchanged, so scenes and prefabs load as they are once the project has both packages. This page lists what moved, what the editor does when a project opens, and what C++ projects need to change.

What moved​

TypeComponent nameNow listed underHeader
plThirdPersonViewComponentThird Person ViewCamerasCamerasPlugin/Views/ThirdPersonViewComponent.h
plHeadBoneComponentHead BoneCameras/LegacyCamerasPlugin/Legacy/HeadBoneComponent.h
plCameraShakeComponentCamera ShakeCameras/LegacyCamerasPlugin/Legacy/CameraShakeComponent.h
plCameraShakeVolumeSphereComponent (and its base plCameraShakeVolumeComponent)Camera Shake Volume SphereCameras/ShakeCamerasPlugin/Volumes/CameraShakeVolumeComponent.h

Names and saved data are the same as in Game Components 1.x. The Third Person View is now a camera view at type version 2: version-1 data loads into the same properties, and the properties added in version 2 default to the old behaviour (see Version-1 compatible defaults). Head Bone and Camera Shake work as before. Their shape icons moved with them.

Package versions​

Game Components 2.0.0 no longer contains these types and declares that it requires plasma.cameras 1.x. A project that updates Game Components to 2.0.0 also needs Gameplay Cameras. Without it, the components above are missing when its scenes load.

When a project opens​

When the editor opens a project, it reads the requirements of the packages the project uses. If an installed package requires one that is not part of the project, the editor lists it ("needed by ...") and offers to add it. Accepting adds the package to the project's Editor/Packages.ddl, and if it is not installed on this machine yet, the normal install prompt follows. Declining logs a warning, and the moved components stay missing until the package is added.

Upgrading a project​

  1. Update Game Components to 2.0.0 in the package manager.
  2. Reopen the project. When the editor offers to add plasma.cameras, accept, and install it if asked.
  3. Open a scene or prefab that uses a Third Person View, Head Bone or Camera Shake and check the components are present with their old values.
  4. For a C++ project, regenerate the project's workspace and rebuild (see below).
  5. Play. Without a Camera Director in the world, the Third Person View still moves its own object exactly as before.

C++ projects​

  • Include paths. The old Game Components headers still exist as forwarding headers, so existing includes keep compiling:

    Old includeForwards to
    GameComponentsPlugin/Cameras/ThirdPersonViewComponent.hCamerasPlugin/Views/ThirdPersonViewComponent.h
    GameComponentsPlugin/Gameplay/HeadBoneComponent.hCamerasPlugin/Legacy/HeadBoneComponent.h
    GameComponentsPlugin/Effects/Shake/CameraShakeComponent.hCamerasPlugin/Legacy/CameraShakeComponent.h
    GameComponentsPlugin/Effects/Shake/CameraShakeVolumeComponent.hCamerasPlugin/Volumes/CameraShakeVolumeComponent.h

    Switch to the new paths when convenient.

  • Linking. The types are now exported by plCamerasPlugin, so code that uses them must link against it. Once the package is part of the project, the editor-generated active-plugins build file (CppSource/Configs/<Project>ActivePlugins.pb.cs) adds the package's include path and plCamerasPlugin's import library. Regenerate the workspace and rebuild.

Scripts​

C# and other scripts bind to components and functions by name, so they need no change. Third Person View's RotateUp and Head Bone's SetVerticalRotation and ChangeVerticalRotation keep their names and arguments.

Moving to the new components (optional)​

Old setupNew setup
Camera with a Third Person View on a child of the characterKeep the view and add a Camera Director to the camera object for blending, volumes and modifiers. See Setting up a third-person camera.
Head Bone under the character's head objectA First Person View under the head object. Scripts calling SetVerticalRotation / ChangeVerticalRotation work on it unchanged. Remove the Head Bone so the camera is not pitched twice.
Camera Shake on a parent of the cameraA Shake modifier on the director with UseShakeVolumes on. It reads the same shake volumes, and also reacts to AddTrauma and Shake impulses.

Troubleshooting​

SymptomLikely cause
Camera components are missing from scenes after updating Game Componentsplasma.cameras is not part of the project. Reopen the project and accept the offer, or add it in the package manager.
Linker errors for plThirdPersonViewComponent or the shake typesThe C++ project was not regenerated after adding the package, so it does not link plCamerasPlugin.
Camera pitches twice as fast in first personBoth a Head Bone and a First Person View pitch the camera. Keep one.

See also: Gameplay Cameras · Camera Views · The Modifier Stack · Camera Director