The next big hurdle I wanted to tackle was the technical art implementation of the flagella, the tail-like organelle that the player will use to swim through the world. I tried a few different methods, each with pros and cons.
The first method I tried was using a skeletal mesh and UE5's Control Rig system. I created a spline, with 6 control points, and fit the skeleton to it. I then animated the controls with sine and cosine translations, with the player's speed as the input for time. This created the effect of the tail spinning rapidly to propel the player, which looked great, but it was lacking one thing: I really needed the tail to lag behind the player as they turned, which wasn't going to be possible for this setup.
My other attempt was to use a Niagara system to spawn points for the tail, and use a cylindrical ribbon to render it. This way, the particles would naturally trail behind as they are generated in world space. To get this to work, I needed to maintain a constant number of particles, repeatedly culling the oldest ones when new ones are generated. This kept the tail length consistent, but was difficult to pull off. I had to write a custom Scratch Pad module that could access all the particle data and accurately select the right one to cull. Adding some jitter to the particles gave it that random motion so it looked like it was propelling itself. This works really well, the only drawback here is that Niagara Particle Update ticks are tied to framerate- meaning if my frames are low, it won't be able to keep up with the culling, and the tail will get longer until it can catch up. I'll find some way around this in the future, but it works for now.