Download

Animating car using timeline

Hi,

I am trying to animate a car for a simulation. Precisely, I need the car to move from point A to point B - possibly following a given path and at a certain speed, maybe using a spline? - and decelerate to eventually stop when reaching point B (at a given distance from point B e.g. 6 meters). When the car stops or is about to, a light that is attached to it should start pulsing for a few seconds and the stop when the car starts moving again to finally reach its last destination, point C. All this would be within a specific timeframe.

I am quite new to UE and I was wondering what the best approach to do that would be? Is a using a timeline a good way to go about this and what would be the best way to set it up? I managed to have my car following a spline but I am not quite sure how I can adjust its speed and deceleration over time. I was suggested to use a trigger box to control the deceleration but I have no idea what a blueprint for this would look like and how to link this to the actor I have created for the car.

I am also having issues setting up the car, and I could not find any tutorials that explain how to configure a vehicle that is not for driving but is just part of the environment so any advice regarding this is also very much welcomed.

I hope this makes sense - I have attached a diagram of what the animation would look like for reference - and thanks for your help!! :blush:

The best approach depends on what the end goal is…

A video?
You need to repeat the behavior over and over. So you can either record with take record ler as you personally drive, or combine the spline movement to a take recording.

In game live cinematic?
A spline.

Move along spline is easy. You’ll find billions of solutions and tutorials on it.

Configuring a vehicle isn’t. Especially not now with chaos…

In fact, if you have no need for physics, forget chaos or physx and just use the spline system.

Fake the car as a block at first. Get that to move to the pattern you need.

Once you have it, you can replace the block with the car model - probably a skeletal mesh, but it doesn’t have to be.

The tires will probably need a shader animation (which is a lot easier to use than physics and won’t wobble like physics).
You can pull a good starter material from the starter content - or just use the mesh too possibly, check the map for it. The point is the shader makes the wheel appear to spin more accurately than anything else.

To trigger the light effect, you either place an actor and use the timeline to trigger it, or you set up a cone that “reacts” (onbeginoverlap) to an invisible actor placed at the end of the path.
Again - think about what the easiest thing you can get away with is (probably the timeline).

You can sometimes even use timeline sequences like this for gameplay stuff, so it depends purely on your situation.

In all occurrences, you can likely benefit from a couple of the beginner game dev tutorials found in the learning tab.
There’s also a few for sequencer that may be even more pertinent here…

1 Like

Thank you for your help! :slight_smile:

I have managed to have the car follow a spline - I did find indeed many tutorials on the topic - but I cannot yet find a way yet to adjust its speed along the spline. What would be the best way to do that?
I am still working on the light.

My end goal is to create a VR simulation where the vehicle is moving along the path and is viewed as part of the 3D environment.

Thank you again!

You could use a timeline with a curve to drive the position.
In the timeline, you set the curve to represent the speed over time with key frame.
On update, you move the position along the spline by using the value of the speed as increments.

There’s other ways too, but that’s probably the easiest for you to control stuff.

1 Like