🎨
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 Space Fighter
  • Setting Up The Player
  • Run The Scene
  • Vehicle Control Animation
  • Ship Control Types

Was this helpful?

  1. Spaceships

Space Fighters

PreviousSpeed UINextCapital Ships

Last updated 12 months ago

Was this helpful?

In this context, a space fighter is a ship that can move and rotate on all 3 spatial axes.

The SCK_Basics_Flying scene provides a fully functioning simple demo of the space fighter if you wish to take a look.

Creating A Space Fighter

The SpaceFighter_Friendly and SpaceFighter_Heavy_Friendly prefabs are fully functional space fighters you can drag into your scenes or modify to create new fighters.

To create a new space fighter:

  1. Create a new game object in the scene and call it whatever you wish

  2. Add a Vehicle component and a Vehicle Engines 3D component

  3. Create a new gameobject as a child of the one you created in Step 1, and call it 'Ship'

  4. Drag your spaceship mesh from your assets folder onto the Ship object

Setting Up The Player

If you just want to get started:

  1. Drag the Player_InputSystem_SCK prefab into the scene.

  2. Go to your new ship, open the Vehicle component, and set the Vehicle Class to SpaceFighter.

OR if you are in the process of creating your own player:

  1. Add a PlayerInput_InputSystem_SpaceshipControls component somewhere in its hierarchy.

Next, open the Game Agent component on the player and set the 'starting vehicle' to your new ship.

Run The Scene

Now when you run the scene, you can use the mouse to steer the ship, and the WASD, Spacebar and Left Control keys to move it around.

The camera may not be set up yet, if not, check out this section.

Vehicle Control Animation

To give you more flexibility to customize the feel of your game, the Vehicle Control Animator component has been provided. Basically, this component rotates the ship slightly relative to its own root transform, according to the velocity and angular velocity of the Rigidbody, to give an extra feel of control to the player.

To set this up, add a Vehicle Control Animator component to an object that is a child of your ship's root transform (create one if it doesn't exist), and make sure the visual components such as meshes are under this child.

This child will now rotate relative to the parent transform when steering and moving the ship. The default values should work well, but you can customize the settings in the inspector to your liking.

If you haven't set up the camera yet, you may need to do so to clearly see the difference in visual effect when controlling the ship.

Ship Control Types

There are a range of different control types in space games, and the Space Combat Kit seeks to cater to them all so you can make whatever type of game you wish.

Open up the PlayerInput_InputSystem_SpaceshipControls component under the Player and take a look in the inspector. Here you will find plenty of settings to customize to control the feel of your game. Here are some key settings.

Linked Yaw And Roll

Some space games link the yaw (side to side rotation) with roll, enabling players to have full control in 3D with less input. An example of a space game with this type of control is Starlancer.

To set this up, go to the PlayerInput_InputSystem_SpaceshipControls component under the Player and set the Link Yaw And Roll checkbox to True.

Auto Roll

Sometimes, you want the ship to maintain level in the scene, allowing the player to roll freely, but returning slowly to level position when they stop rolling.

To set this up, go to the PlayerInput_InputSystem_SpaceshipControls component under the Player and set the Auto Roll Enabled checkbox to True.

Mouse Steering Type

You may want the ship to rotate according to the position of the cursor on the screen, or according to the current movement of the mouse. Many games provide the option for both to the player, which you can too.

By setting the Mouse Steering Type in the inspector of the PlayerInput_InputSystem_SpaceshipControls component, you can set the mouse control to either of these types.

There are also other settings related to the mouse, such as the dead radius.

Throttle Setting

You may want the player to incrementally control the throttle with the W and S keys (or whatever input you have defined) or to have the throttle go to full when it is pressed and 0 when released.

For the former, make sure the Set Throttle checkbox is unchecked in the inspector of the PlayerInput_InputSystem_SpaceshipControls component and customize the Throttle Sensitivity value.

For the latter, make sure the Set Throttle checkbox is checked in the inspector of the PlayerInput_InputSystem_SpaceshipControls component.

Create the player Game Agent as described in if you haven't already.

this section
Create a space fighter using the Space Combat Kit and learn how to customize it for your game.