-- Setup – get the root entity to use as a search location
entRoot=Game.GetRootEntity();

-- View the scene from a given camera for a given period of time
function ViewFromStaticCamera(camName, duration)
    currentCamera = Entity.FindName(entRoot, camName);
    Game.SetWindowEntity(0, currentCamera);
    Script.WaitSec(duration);
    end

-- Set the scene to the given waypoint camera and reset the camera to
-- the given waypoint for the given duration
function ViewFromWaypointCamera(camName, waypointName, duration)
    currentCamera = Entity.FindName(entRoot, camName);
    Game.SetWindowEntity(0, currentCamera);
    Game.CameraSetWaypoint(currentCamera, waypointName);
    Script.WaitSec(duration);
    end


-- camera shots
ViewFromWaypointCamera("CameraPreRaceFlyby", "CW0", 7.5);
ViewFromWaypointCamera("CameraPreRaceFlyby", "CW4", 4.0);
ViewFromWaypointCamera("CameraPreRaceFlyby", "CW9", 12.0);
ViewFromWaypointCamera("CameraPreRaceToStart", "CTS0", 10.5);

-- calling this signals the game that the intro is over
Game.SetIntroDone(1);
