🎨
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
  • Setting Up
  • Viewport Position
  • Aim Direction
  • Center The Cursor

Was this helpful?

  1. HUD

HUD Cursor / Reticle

The HUD cursor/reticle is a UI object that is controlled by the mouse, and helps with weapon aiming, target selection, steering and more.

The HUD cursor is not the same as the normal mouse cursor. They are separate because it is not possible to have full control of the mouse cursor (for example setting its position is not possible).

Typically, the HUD Cursor is controlled by one of the player's input scripts - in the case of the Space Combat Kit, it's controlled by the PlayerInput_InputSystem_SpaceshipControls component.

The Mech Combat Kit does not use a HUD cursor.

Setting Up

To set up the HUD cursor:

  1. Add a HUD Cursor component to your vehicle

  2. Customize the inspector settings

You will need to create a canvas and create the cursor UI object to fill out these settings.

Viewport Position

The viewport position is the position on a screen with a width and height of 1 (so for example, the viewport position of the center of the screen is (0.5, 0.5).

You can get or set the viewport position of the HUD cursor as follows:

// Get the viewport position
Vector3 viewportPos = myHUDCursor.ViewportPosition;

// Set the viewport position
myHUDCursor.SetViewportPosition(somePosition);

Aim Direction

You may want to know what direction in the scene the cursor is aiming, for example to know if it is pointing at an object.

You can get this with the following code:

// Get the world space aim direction
Vector3 aimDirection = myHUDCursor.AimDirection;

Center The Cursor

To set the HUD Cursor at the center of the screen, use the following code:

// Center the HUD cursor
myHUDCursor.CenterCursor();

PreviousCamera View ManagementNextWeapon UI

Last updated 8 months ago

Was this helpful?