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
| Type | Component name | Now listed under | Header |
|---|---|---|---|
plThirdPersonViewComponent | Third Person View | Cameras | CamerasPlugin/Views/ThirdPersonViewComponent.h |
plHeadBoneComponent | Head Bone | Cameras/Legacy | CamerasPlugin/Legacy/HeadBoneComponent.h |
plCameraShakeComponent | Camera Shake | Cameras/Legacy | CamerasPlugin/Legacy/CameraShakeComponent.h |
plCameraShakeVolumeSphereComponent (and its base plCameraShakeVolumeComponent) | Camera Shake Volume Sphere | Cameras/Shake | CamerasPlugin/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
- Update Game Components to 2.0.0 in the package manager.
- Reopen the project. When the editor offers to add
plasma.cameras, accept, and install it if asked. - 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.
- For a C++ project, regenerate the project's workspace and rebuild (see below).
- 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 include Forwards to GameComponentsPlugin/Cameras/ThirdPersonViewComponent.hCamerasPlugin/Views/ThirdPersonViewComponent.hGameComponentsPlugin/Gameplay/HeadBoneComponent.hCamerasPlugin/Legacy/HeadBoneComponent.hGameComponentsPlugin/Effects/Shake/CameraShakeComponent.hCamerasPlugin/Legacy/CameraShakeComponent.hGameComponentsPlugin/Effects/Shake/CameraShakeVolumeComponent.hCamerasPlugin/Volumes/CameraShakeVolumeComponent.hSwitch 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 andplCamerasPlugin'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 setup | New setup |
|---|---|
| Camera with a Third Person View on a child of the character | Keep 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 object | A 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 camera | A Shake modifier on the director with UseShakeVolumes on. It reads the same shake volumes, and also reacts to AddTrauma and Shake impulses. |
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Camera components are missing from scenes after updating Game Components | plasma.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 types | The C++ project was not regenerated after adding the package, so it does not link plCamerasPlugin. |
| Camera pitches twice as fast in first person | Both a Head Bone and a First Person View pitch the camera. Keep one. |
See also: Gameplay Cameras · Camera Views · The Modifier Stack · Camera Director