Example: 3D rail shooter
The camera follows a scripted route while target hits are converted to camera raycasts. This produces a polished 3D game without the cost of a full FPS.
Main components
- Cinemachine Dolly Track or Timeline;
- gameplay camera;
- shootable-object layer;
- character Animator controllers;
- mission sequence controller;
- VORIVOX SDK.
Raycast from a hit
private void OnHit(VorivoxHit hit)
{
Ray ray = gameplayCamera.ViewportPointToRay(
new Vector3(hit.NormalizedX, hit.NormalizedY, 0f));
if (!Physics.Raycast(ray, out RaycastHit rayHit, 250f, targetMask))
{
RegisterMiss();
return;
}
if (rayHit.collider.TryGetComponent(out ShootableTarget target))
{
int points = target.ApplyShot(rayHit.point);
AddScore(points);
SpawnImpact(rayHit);
}
}
Mission flow
Briefing → Warehouse yard → Corridor → Hostage room → Result
20 sec 35 sec 25 sec
Optimization
- bake lighting where the scene is static;
- use LOD Group;
- limit transparent particle overdraw;
- preload critical materials before
ReadyAsync(); - do not download Addressables from the internet.