The rail shooter template contains dynamic game elements from the classic rail shooter genre. Players travel along a predetermined path, shooting at enemies that appear on the screen. The aim is to survive for as long as possible and score as many points as possible. This template would be a good starting point for a game with an arcade-style feel.
Quick Start Video:
To create a Rail Shooter game, you will need to have Unity 2020.3 or newer, and be using any of the Unity pipelines (Built-in, URP, HDRP). While the template works in those pipelines, there is no dedicated setup process for switching to a different render pipeline within the Game template. The assets included within the template use the unity standard shader and can therefore be migrated to the pipeline materials via the material updater of the respective render pipeline. Additional assets that are being used in your scene would need to be setup for those pipelines as well.
Additionally, you will need install GeNa Pro v3.3.x or above.
Installing Gaia 3.2.0 or higher is optional, but allows you to quickly add a terrain to your scenes as a backdrop for the first levels you build. There is one “complete” demo scene included in the package that features a complete level including a Gaia terrain. This scene requires Gaia Pro to be present to be displayed correctly.
Installing Post-Processing for the built-in render pipeline is optional but recommended.
The quickest possible way to experience the rail shooter template is by running the two included demo scenes:
The “Railshooter” scene is a barebones scene with only the core elements in it. Ideal if you want to focus on the assets / tech from the template in isolation.
The “Railshooter_Gaia-Complete” scene contains a terrain, water and other elements that were created with Gaia. It is closer to an actual game, but requires you to have Gaia Pro in the project installed as well. Otherwise this scene will not display correctly as it is missing the contents from the Gaia package.
The Rail Shooter system is a great way to create dynamic and action-packed gameplay without having to worry about too many complex game mechanics. It's a simple template that you can use to create your own rail shooter system, and it's easy to get started.
Please note that all the following assets you need are located in the folder located under Procedural Worlds > Game Templates > Rail Shooter.
1. Clicking and dragging the ‘Rail Shooter’ Prefab located under Rail Shooter > Prefabs and drop it into your scene.
2. You can then add Enemies into your scene by dragging the Enemy prefab located under Prefabs > Enemies.
Then you can give your Enemies some waypoints by clicking and dragging the Waypoints into the Scene located under Prefabs > Waypoints:
You can then get the enemies to reference the Waypoints by dragging the Waypoint parent (Empty) GameObject into your Enemies.
Alternatively, you can also spawn Enemies using ‘Spawner – Enemies’ located in Asset Samples > GeNa > Spawners
3. You can also drag powerups into your scene by dragging the Powerup prefabs located under Prefabs > Powerups.
Alternatively, you can also spawn Powerups using either ‘Spawner – TwinPowerup’ or ‘Spawner – HyperPowerup’ located in Asset Samples > GeNa > Spawners
4. Now you can now hit play to test your game!
5. The procedure as described above will allow for free player movement – if you want to make a real rail shooter where the player movement is “on rails” you can create a GeNa spline from the scene hierarchy:
6. With the spline object selected in the hierarchy, press Ctrl + Click to set spline points in the scene. The nodes can be clicked on individually to re-position them.
7. With the spline in place, drag and drop the spline object into the spline slot in the “Game Manager” object inside the Rail Shooter prefab:
When you run the scene now, the player movement will be restricted to following the spline – a true rail shooter experience!
The Game Manager found in the Rail Shooter prefab is the single most important entity in a game. It controls the flow of the entire game and handles all the basic functionality. There are many different aspects of the Game Manager that can be configured to change how the game works. This includes settings for things like the time scale, the current game state, the prefabs to spawn, what sound effects play, and more. In short, the Game Manager is responsible for making sure the game behaves as desired.
All the settings inside of the Game Manager.
Game State: The current state of the game.
Time Scale: The scale at which time passes. This can be used for slow-motion effects or to speed up your game.
Game Camera: The main game camera to be used for the game.
Player: A reference to the Player ship.
Enemy Prefab: Prefab of the Enemy.
Single Laser Prefab: Prefab of the Single Laser Entity.
Twin Laser Prefab: Prefab of the Twin Laser Entity.
Hyper Laser Prefab: Prefab of the Hyper Laser Entity.
Enemy Laser Prefab: Prefab of the Enemy Laser Entity.
Explosion Prefab: Prefab of the Explosion Particle Entity.
Base Audio Source Prefab: Reference to prefab containing default audio source settings.
Single Laser Clip: The audio clip to play when firing a single laser.
Twin Laser Clip: The audio clip to play when firing a twin laser.
Hyper Laser Clip: The audio clip to play when firing a hyper laser.
Explosion Clip: The audio clip to play when emitting an explosion.
Powerup Clip: The audio clip to play when picking up a powerup.
Min Max Random Pitch: The min and max range to randomise pitch when calling PlayOneShot and passing in true for ‘randomized pitch’.
UX Animator: Reference to the Animator that controls the UI screens in-game.
Boost Animator: Reference to the Animator that controls the boost animation effects.
Score Text: Reference to the Text Element that displays the game’s score.
Boost Slider: Reference to Slider UI element for displaying boosting stamina.
Settings for configuring the GeNa Spline track logic.
Spline: Reference to a GeNa Spline for following a track.
Loop: Should the player controller loop around the spline track?
Spline Distance: The current distance along the spline.
There are no comments to display.