Website powered by

Blood Shot: Player Movement Along a Spline

Blood Shot is a Interaccess Media Arts Prize nominated first-person shooter game made in Unity, solo-developed from scratch and inspired by Star Fox, Playstation 1 games and medical photography techniques.
Using a connected series of splines that were used to generate the geometry of the tunnels that make up the levels, the player is forced forwards along said spline, lerping between rotations for each point on the spline to keep them facing forward and moving smoothly. Players can move away from the centre but that offset distance is capped to keep them inside the level's geometry, avoiding the use of heavy colliders.

Check out the game at https://garbange.itch.io/blood-shot

Here a series of splines combine to generate both the level's tube-like geometry and also serve as the path the player is pushed along, although the player can deviate the position and rotation slightly with input.

Here a series of splines combine to generate both the level's tube-like geometry and also serve as the path the player is pushed along, although the player can deviate the position and rotation slightly with input.

Third-person segments don't allow for offset from the spline centre, but do allow for going up or down the splines, and for choosing which branch of the splines to follow when they split.

Third-person segments don't allow for offset from the spline centre, but do allow for going up or down the splines, and for choosing which branch of the splines to follow when they split.

Players can use WASD keys or the direction of the mouse to move up or down in relation to the current spline direction, using vector projection so that only the up and right of the player's vector influences the position offset.

Players can use WASD keys or the direction of the mouse to move up or down in relation to the current spline direction, using vector projection so that only the up and right of the player's vector influences the position offset.

The C# function that adds positional offset to the player based on the direction they are looking in relation to the spline.

The C# function that adds positional offset to the player based on the direction they are looking in relation to the spline.