🎨
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
  • Creating A Vehicle Input Script
  • Initialization

Was this helpful?

  1. Input

Vehicle Input

Vehicle input is input that is run for a specific vehicle, for example a spaceship controller script. Vehicle input scripts extend the General Input base class, and must be placed in the hierarchy of a Game Agent.

A Game Agent gathers and stores all the Vehicle Input scripts in its hierarchy when the scene starts, and attempts to initialize them when it enters a new vehicle.

Creating A Vehicle Input Script

To create your own Vehicle Input script, create a new script that extends the Vehicle Input base class:

using VSX.UniversalVehicleCombat;

// Custom vehicle input script 
public class MyVehicleInput : VehicleInput {}

Initialization

When a Vehicle Input script is initialized, it means it has access to all the components on the vehicle that it needs to control, and is ready to run.

Vehicle Input scripts are not initialized by default. You must override the Initialize function in your own scripts to run your own checks on the vehicle that the Game Agent is entering, and only return True if the script is ready to run.

// Override the Initialize function
protected override bool Initialize(Vehicle vehicle)
{
    // Check that the vehicle is compatible with the input
}

// Check if input script is initialized
if (myVehicleInputScript.Initialized)
{
    // Some code
}

// Do something if initialization fails 
protected override void OnInitializationFailed()
{
    // Some code
}
  • Enabling/disabling input

  • Adding input update conditions

  • Adding your input code

PreviousGeneral InputNextRewired Integration

Last updated 2 years ago

Was this helpful?

The rest of the General Input script functionality applies to the Vehicle Input script as well, see for:

this section