# 5. Worked Example: Patrol, Dolly, and Posts Part of [[Splines]]. Prev: [[4. SplineAnimate Dollies and Cameras]]. Next: [[6. Splines Pitfalls]]. One `SplineContainer` can feed three consumers. That is the point of authored path data. ## 5.1 Author the path 1. Gray-box a small courtyard (or reuse a [[ProBuilder Gray-Boxing and Landmarks]] blockout) with one weenie (a tall prop) on one side. 2. Closed spline at chest height for a *guard*, plus a second spline (same container, second spline, or a second container) at a higher, smoother line for a *camera tour*. Two jobs, two curves - do not force a chest-high patrol to also be a pretty dolly. 3. Confirm the container is not at a hidden scale (1,1,1). ## 5.2 Posts `SplinePrefabsPlacer` on the courtyard spline, 8-12 posts, look along tangent. Run Place once with the container off-origin to prove space conversion. Parent the instances under a "Fence" object. ## 5.3 Patrol NPC capsule, `SplineAnimate` on the courtyard spline, loop, modest speed, alignment yaw-only if the Inspector allows (or accept full alignment and flatten later). Tag the player; leave chase for [[Enemy AI State Machine]] - this exercise is "walk the loop." ## 5.4 Dolly `DollyCart` + `SplineAnimate` on the camera spline, play-on-awake off. A Cinemachine camera follows the cart. A trigger near the courtyard entrance calls `Restart()` + `Play()` ([[4. SplineAnimate Dollies and Cameras]]). Look at the weenie with a second aim target if you want a directed beat ([[3. Weenies Landmarks and Lighting as Wayfinding]]). ## 5.5 Playtest checklist 1. Posts sit on the visible curve, not at world zero and not at 2x the container position. 2. The guard loops without a hitch at knot 0 (closed spline). 3. The dolly plays once per trigger and can `Restart`. 4. The follow camera is on the cart, not on the spline GameObject itself (the container does not move). ## Exercise Pause the patrol when the dolly plays, then `Play()` it again when the dolly ends (`SplineAnimate` completed event if 2.9 exposes one - confirm in the Inspector / API; otherwise a coroutine for duration). That is a Beat: the world holds for a look ([[Level Up! (Review)]] Level 12). ## Sources - `SplineAnimate`: https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.Splines.SplineAnimate.html