Using Camera Prefabs

Starting with GameCore 2.5, we have separated the Camera settings from the Player script in order to streamline the number of properties that need to be adjusted when creating a character from scratch.  This has greatly simplified the number of steps involved in creating a character, but has resulted in an additional step - namely that of specifying a camera mode that you wish to use for your character.

Note that the available camera configuration templates that ships with GameCore is by no means that only available modes supported by the script - you are still free to adjust the settings as before to create your own custom camera / player controls for your game, but we have tried to provide a few common 'template' camera modes for you to choose between as a starting point.

Adding a Camera Settings Template

Adding a Camera Template into your game is fairly straightforward.  You simply add one of the available Camera Settings templates into your world and tell your player character which camera template it should use. This is done using the standard 'add object from template' steps that are used for any of the GameCore templates.

  1. Click 'Add' on the Items Panel
  2. Select 'From Template'
  3. Navigate to 'Game Settings -> Camera Settings'
  4. Pick which Camera Settings template you wish to use (see below)
  5. Click 'Open'

This will add the camera settings object to your world where it is ready to be used / linked to from your player character.

Prefab / Template Camera Modes

Currently (in GameCore 2.5.x) there are 3 default camera modes that can be enabled easily:

  1. First Person Camera
  2. Third Person 'Chase' Camera - ie DefaultPlayerCamera
  3. Third Person 'Fixed' Camera - ie RifleWeaponCamera

I'll explain a bit of how each of the modes work, and how they can be applied to your character, and then finally we'll go through the actual camera settings to explain how you can easily create custom camera modes by modifying one of these templates.

First Person Camera

The First Person camera mode is what you would expect - a basic FPS style camera mode that allows you to look around with the mouse and move the player using the wsad (or arrow) keys.

To add this Camera Settings template to your world, click:

Add->From Template->GameSettings->CameraSettings->FirstPersonCamera

Third Person 'Chase' Camera

The 'DefaultPlayerCamera' Camera Settings template is a camera mode that provides a simple GTA style chase camera.  You can move / rotate the camera independently of the player object (so you can rotate around the character without turning them) - and all movement is 'camera-relative'.

To add this Camera Settings template to your world, click:

Add->From Template->GameSettings->CameraSettings->DefaultPlayerCamera

Third Person 'Fixed' Camera

The final CameraSettings prefab is a 3rd person 'Fixed' camera that behaves similar to the FPS camera, except that the camera is positioned & fixed behind the character's head.

To add this Camera Settings template to your world, click:

Add->From Template->GameSettings->CameraSettings->RifleWeaponCamera

Linking the Camera Settings template to your Player

Another way to think of this is basically 'telling your player which camera mode that you wish to use'.

The default character controller supports the ability to have multiple camera modes defined, and also provides functionality to allow switching between the modes as desired.  This can be useful while testing your game, or if you wish to provide first & 3rd person camera modes within your game that can be switched between on the fly.

To link a Camera Settings template to your character once you have added the Camera Settings template into your world, you:

  1. Select your character object
  2. go to the Controller tab on the Object Properties panel
  3. Scroll through the defined Controller Settings list to find the 'CameraSettingsObject' property & double click this value to modify it
  4. Enter the name of the CameraSettings object that you have added to your world.

In the image below, you can see an example of this - I have added a Camera Settings object called 'FirstPersonCamera' into my world (in this case the default Island Demo that ships with GameCore).  I have the CameraSettingsObject property open for editing, and have entered the name of the CameraSettings object that I wish to apply to my character (in this case 'FirstPersonCamera'). 

That's all that I need to do!

In the above screenshot, the 3 colored boxes beside the soldier are the different CameraSettings templates that I've added.