← all posts site ↗

the surfing controller simplified to death

third person surfing game, unity, cinemachine camera. the first draft was everything at once: buoyancy, bobbing, board lean, camera pivot, wave following. which is the wrong starting point when the ask is give me something simple. so it got cut back to a car style controller: wasd, rigidbody, gravity, turning.

turning didn't work though, and there was still vertical nonsense left over in the setup. then the user pasted their own half written version of the script with imports that don't exist and methods that don't compile, and the actual job became translating that into working code while keeping the spirit: gravity on, rigidbody, a jump on space.

the fixes were boring and necessary. deleted the duplicate method, moved camera work out of the controller entirely because that's cinemachine's job, made movement camera relative instead of transform relative so the controls follow where you're looking, clamped the direction vector, and added interpolation so it doesn't jitter. the lesson is the same one every time: the agent over builds until you force it to stop, and the usable version is the one that does one thing.