🎨
UVC
  • Introduction
  • Installation
    • Installing in New Project
    • Installing in Existing Project - SCK
    • Installing in Existing Project - MCK
  • Space Combat Kit Tour
  • Mech Combat Kit Tour
  • Player Setup
  • Vehicle Framework
    • Game Agents
    • Vehicles
    • Modules
      • Module Mounts
      • Modules
      • Module Types
      • Module Attachments
      • Display Module On UI
      • Module Managers
  • Input
    • General Input
    • Vehicle Input
    • Rewired Integration
  • Player/AI
  • Spaceships
    • Speed UI
    • Space Fighters
    • Capital Ships
  • Mechs
    • Speed UI
  • Vehicle Control Animations
  • Character Enter/Exit
  • Camera
    • Camera Setup
    • Vehicle Setup
    • Secondary Cameras
    • Death Camera
  • Weapons
    • Framework
      • Triggerables System
      • Weapon System
    • Vehicle Setup
      • Vehicle Weapons
      • Cursor Aiming
    • Projectile Weapons
    • Beam Weapons
    • Missile Weapons
    • Resource Handling (Ammo/Heat)
    • Turrets
    • HUD Weapon Info
    • Health Modifier Volumes
  • Radar
    • Radar Setup
    • Target Setup
    • Target Selectors
    • Trackable Types
    • Improving Radar Performance
    • Target Notification
    • Radar Audio
  • Health
    • Health Framework
      • Health
      • Damageable
      • Damage Receiver
      • Health Modifier
      • Health Types
      • Health Modifier Types
      • Surface Types
    • Vehicle Setup
    • Damageable Object Setup
    • Detonators
    • Health Recharge
    • Health UI
    • Energy Shield
    • Damageable Module Linkers
  • HUD
    • HUD Basics
    • HUD Manager Setup
    • Custom HUD Components
    • HUD Module Display
    • Camera View Management
    • HUD Cursor / Reticle
    • Weapon UI
    • Resource Container UI
    • 2D Radar
    • 3D Radar
    • Target Boxes
    • Target Holograms
    • Minimaps
    • HUD Distance Lookup
  • Loadout
  • AI - Space Combat Kit
    • AI Setup
    • AI Spaceship Behaviours
  • AI - Mech Combat Kit
  • Game States
  • Teams
  • Floating Origin
  • Object Pooling
  • Menus
    • Creating Menus
    • Button Controllers
  • Rumbles
  • Rigidbody Characters [WIP]
  • Utilities [WIP]
    • Object Triggers
    • Shadow Caster Doubles
    • Gimbals
    • Game State Post Process Enabler
  • Objectives
  • Resources System
    • Resource Containers
    • Resource Handlers
    • Resource Container Triggers
    • Module/Vehicle Resource Usage
    • UI
  • Cutscenes
  • URP Upgrading
Powered by GitBook
On this page
  • Quick Setup
  • Adding Objectives
  • Creating Your Own Objectives
  • Adding Waypoints

Was this helpful?

Objectives

Learn how to create player objectives in your game.

PreviousGame State Post Process EnablerNextResources System

Last updated 12 months ago

Was this helpful?

The Objectives system enables you to create objectives for the player to complete, and display them in a list on the UI.

Quick Setup

These instructions focus on creating Destroy objectives, which are objectives that are completed when specific targets in the scene are destroyed. The process is the same for all other objective types.

  1. Add a damageable object to your scene.

  2. Add a Destroy Objective component somewhere in your scene and customize the description in the inspector.

  3. Drag the damageable object from Step 1 into the Targets list.

  4. Drag the ObjectivesUI prefab into the scene.

  5. Play the game! Now the objective appears on the left hand side of the HUD, and when the target is destroyed, a sound effect and text animation plays.

Adding Objectives

If you want to add more targets to the same objective, just drag each one into the Targets list in the inspector of the Destroy Objective component. The UI will automatically display the total number of sub-objectives, and the number of sub-objectives that have been destroyed.

You can add any number of additional objectives to the scene by adding more Destroy Objective components (or any components that extend the Objective Controller base class, for other types of objectives). They will be automatically displayed on the UI.

Creating Your Own Objectives

With a little coding you can create all kinds of custom objectives for your game.

The Objective Controller base class (which the Destroy Objective derives from) can be extended with your code to create all kinds of other objectives. Simply by adding these objectives to the scene, they will be displayed on the UI.

  1. To begin, create your own script that extends the Objective Controller base class.

  2. Next, override the Is Completed function with your code that checks if an objective is completed or not. It should return True if the objective is completed, or False if it is not, like so.

// My objective controller
public class MyObjectiveController : ObjectiveController
{
    protected override bool IsCompleted
    {
        // Add your own code to check if the objective is completed. Return True
        // if completed, or False if not.
    }
}
  1. Then, anytime something happens with the objective that may indicate that its state has changed, simply call the On Objective Changed function, and the rest will be handled automatically.

Adding Waypoints

You may want to add waypoints to objectives that become active when the player is far from the objective, and are deactivated as they approach.

  1. Add a new gameobject to the scene and call it 'Waypoint' (or whatever you wish)

  2. Drag it into a position near the objective location.

  3. Add a Trackable component and set the Trackable Type to Waypoint.

  4. Add a Game Agent Trigger component and set the distance threshold where you want the waypoint to be activated.

  5. In the On Triggered event, drag in the Trackable component and call its Set Activation function (setting it to False).

  6. In the On Trigger Reset event, drag in the Trackable component and call its Set Activation function (setting it to True).

The waypoint should appear on the HUD, if you need to troubleshoot that refer to the HUD documentation.

Learn how to add player objectives to your game.