How can I efficiently make an animated character follow a Spline Track, so that a non-playable character moves forward when there is a walking animation playing, and is standing still when an idle animation is playing?
Hej! That’s my question in short! I’m completely new to game development and I feel like I’m doing a lot more work then I need to do, so I thought I’d show a bit of my progress and maybe get some tips on how to do it quicker in the future. This is my first project in Unreal Engine (5), and, so far, I’ve programmed everything with Blueprints.
I’m currently working on a project that I would describe as an interactive dinosaur documentary, where the player walks around during the age of the dinosaurs, and is informed by a narrator whenever they get close to a dinosaur. Just like in a documentary, there is a narrator and an informative environment, but unlike a documentary, in my game you can choose which dinosaurs you want to hear about, so you can basically skip the boring parts.
Naturally, I’m going to need a dinosaur that follows a path and shows a bit of their daily routine. The best way to do that, I thought, was by creating a Spline Track. For that, I followed this tutorial: Ue4 Tutorial - Moving an Object along a path using a Spline Track - YouTube
However, for a naturalistic touch, the dinosaur also needs to stop moving occasionally. I did this by keeping the position the same on the timeline of the Spline Track, and thus turning the velocity to 0 u/s. This worked, but was an extremely time-consuming job, since I had to match the timing of the timeline exactly with the timing of my animations. On top of that, I manually calculated the new distance for the Spline Track after every period of walking by multiplying the speed with the time the animations took.
I guess what I really want to know is; is there a way to make an NPC move with a constant speed, whenever a certain animation is played? So that, for example, after every step, the dinosaur walks two units.