The Player Ship

Four weapon mounts, tuned movement, pointer steering and scripted entry and exit flights.

๐Ÿš€4 mounts
โฑ๏ธ9 min read
๐Ÿ–ฑ๏ธDrag steering
๐ŸŽฌEntry flights
ASKPlayerPawnBase ยท USKPawnMovementComponent ยท USKTouchDragComponent

The player ship is a pawn with four weapon mounts, a movement component tuned for shmup feel, and optional pointer steering. Subclass it once in Blueprint and you have a playable ship.

Mounts

Four weapon components: Front, Left, Right and Rear. The rear mount ships pre-configured to fire backwards. Which button fires each one is worked out automatically โ€” see Weapons.

Movement

PropertyDefaultPurpose
Move Speed800Top speed.
Lerp Speed5Acceleration character. Higher is snappier; 0 is instant, which suits a precise bullet-hell feel.
Bank Angle15Degrees the mesh rolls when moving sideways. Purely visual, and it does more for feel than its size suggests.
Bank Lerp Speed8How quickly the roll eases in.
Min Bounds / Max Boundsยฑ700 / ยฑ500The play area, in world units. The ship is clamped inside this.
The bounds are a play area, not physics. Scripted entry and exit flights lift the clamp so the ship can genuinely leave the screen, then restore it on arrival.

Input

Enhanced Input throughout. The shipped BP_PlayerPawn carries the default assets; set your own on a subclass to rebind.

PropertyPurpose
Default Mapping ContextApplied when the pawn is possessed.
Move Action2D movement input.
Fire ActionMain fire button.
Fire Left ActionFires the left manual mount โ€” middle mouse by default.
Fire Right ActionFires the right manual mount โ€” right mouse by default.

Firing is driven by which buttons are currently held rather than by press and release events. That is what allows one mount to answer several buttons, and it means releasing one button while another is still down does not interrupt fire โ€” including through a mid-hold weapon swap.

Blueprint hooks

EventFires
On Fire / On Stop FireThe main button is pressed or released โ€” for recoil, a muzzle flash or an animation.
On Pawn Damaged / On Pawn DeathInherited from the pawn base.

Pointer steering

USKTouchDragComponent

Poke-and-drag steering: mouse on desktop, touch on mobile. It coexists with keyboard and gamepad โ€” the most recent input wins โ€” so you don't choose one scheme at build time.

PropertyDefaultPurpose
Drag EnabledOnMaster switch. Turn it off for keys only.
Mouse SteeringOnAllow the mouse to steer as well as touch.
Drag Sensitivity1Hand movement to ship movement ratio. At 1, a full-screen-height drag crosses the full play area.
Invert YOffFlip the vertical axis.
Poking never moves the ship โ€” the first touched frame only anchors, and a finger lifted and replaced starts fresh. That is what makes it drag rather than teleport, and it is why the ship never jumps to your finger.

Steering uses raw pointer deltas rather than cursor position, so it is unbounded at screen edges, needs no cursor warping, and behaves identically on every platform. Movement is resolution and aspect independent.

Entry and exit flights

The ship can fly in at the start of a stage and out when it is cleared. Both suspend control and guns, lift the play-area bounds, and make the ship untouchable for the duration โ€” being shot down during a cinematic you can't control is simply unfair.

PropertyDefaultPurpose
Intro Duration0Seconds the entry takes. 0 is off โ€” the ship starts where it is placed.
Intro Start Offset-1200, 0Where it flies in from, relative to its spawn point.
Intro Overshoot0.2How far it sails past its mark before settling back, as a share of the trip. The settle is what makes it read as an arrival rather than a slide to a halt. 0 gives a plain glide.
Intro Spin Degrees720Barrel roll during the entry. Use multiples of 360 or the ship finishes banked.
Play Intro On RespawnOffReplay the entry on every respawn. Off by default โ€” a respawn already has its invulnerability window, and the cinematic gets old fast.
Outro Duration0Seconds the exit takes. Keep it below Stage Clear Delay or the level travels before the flight finishes.
Outro End Offset2000, 0Where it flies out to.
Outro Backup0.2How far it draws back before launching away. The little run-up sells the departure as deliberate.
Outro Spin Degrees720Barrel roll on the way out.
Function / EventPurpose
Play Intro / Play OutroTrigger a flight manually. Both no-op when their duration is 0.
Cancel SequenceAbort a flight in progress, restoring control, bounds and collision.
Is Playing SequenceTrue while either flight runs.
On Intro Finished / On Outro FinishedBlueprint hooks for FX and audio. The stage transition runs on its own timer, so these are for presentation only.

Blob shadows

USKBlobShadowComponent

A cheap ground shadow, drawn as a decal so it lands correctly on real terrain at any height rather than floating on a flat plane. Add it to ships and other significant actors โ€” a decal per bullet would be expensive.

PropertyDefaultPurpose
Radius100Size of the blob.
Projection Depth2000How far down it projects. Must exceed the ship's height above the terrain or nothing lands โ€” this is the most common reason a blob shadow appears to do nothing.
Keep World DownOnHolds the projection pointing straight down, so a banking ship's shadow doesn't skew with it.

A procedural material is recommended over a texture: nothing to license, resolution-independent and free of compression banding. A Deferred Decal, Translucent and Unlit, with a radial gradient driving opacity over a black base colour, is the whole recipe.

Common fixes

  • The ship won't leave the screen during an exit flight โ€” that is the bounds clamp; flights lift it automatically, so check Outro Duration is above 0
  • The exit is cut off mid-air โ€” Outro Duration exceeds Stage Clear Delay
  • The ship finishes banked after an entry โ€” the spin isn't a whole multiple of 360
  • Mouse steering fights the keyboard โ€” that is most-recent-input-wins working; turn off Mouse Steering for keys only
  • No blob shadow โ€” Projection Depth is shorter than the ship's height above the ground

Where next

Weapons

Arm the four mounts.

Read โ†’

Resources

Health, shields and energy.

Read โ†’

Progression

Lives, respawn and stage travel.

Read โ†’