Is it possible to have static Meshes share the same Timeline but different play rate?

Hi everyone,

Assume I have 8 static meshes, and they are separated into 3 different groups. They all need to do something with the same timeline but at different times. You may see the picture below for more detail.

However, I encountered some issues.
I tried to duplicate the timeline. However, whenever I duplicate the timeline, a new one is created. I don’t want to manually set the timeline again. That is labor intensive.

I know there is a set play rate node that allows users to alter the play rate of the timeline. Is it possible to start the 2nd action before the 1st action ends?

Hey YTCK! Welcome to the forums!

For this, could you possibly just use 3 separate tracks and 3 separate output within the timeline, and just put the first key in each line where you’d like the other static meshes to start?

create a timeline , then add two key create a float curve, one key value is 0 , another is 1 :


then you can do this , for example you timeline have 5s, in 4s the float curve value maybe 0.8, so you can create you logic like:

Hey again @YTCK!

I’m gonna show you what I was talking about.

So this is what the timeline will look like. You can add multiple outputs to the timeline, and then have a different float output for each. Here I have ABC, DEF, GH on separate floats going from 0 to 1 at different times. Hope you can use this to get what you’re going for!


image

1 Like

Hi Mind-Brain

Do you know if there is any way to use the curve without the timeline?

It is that inside the components the timelines cannot be used…

I had to simulate one by the hard way…

I couldn’t find any other way to do it.

Maybe you know a way to use the curves inside the components…

thx u so much!!

Whoa, nice blueprint math there Ivan3z!

But no, can’t use a timeline inside a component, BUT on the actor it’s attached to you can run a timeline, and set the value on the component from there. Just drop the component on the actor’s event graph and set the value :wink:

1 Like

Ok, I’ll do that if I have to… I really try to make my components with the max abstraction level as possible. It’s a pity not being able to use the curves.

Thank you very much MainBrain!! :sparkling_heart:

You could use timers inside of components with an update function and take in a curve but in c++. Not sure if it’s possible in bp.

variables in header


	float passedTime;
	UPROPERTY(editAnywhere, BlueprintReadWrite)
		class UCurveFloat* TimelineCurve;
	
	UPROPERTY(editAnywhere, BlueprintReadWrite)
		class UTimelineComponent* MyTimeline;
	
	FOnTimelineFloat InterpFunction{};

	UFUNCTION()
		void TimelineUpdate(float val);

in cpp

include at top

#include "TimerManager.h"
#include "Components/TimelineComponent.h" 
#include "Curves/CurveFloat.h" 

in constructor (CDO)

UMySceneComponent::UMySceneComponent()
{
	TimelineCurve = CreateDefaultSubobject<UCurveFloat>(TEXT("Timeline Curve"));		
	MyTimeline = CreateDefaultSubobject<UTimelineComponent>(TEXT("Timeline"));		
}

in begin play

void UMySceneComponent::BeginPlay()
{
if (TimelineCurve != nullptr) {
		InterpFunction.BindUFunction(this, FName{ TEXT("TimelineUpdate") });
		MyTimeline->AddInterpFloat(TimelineCurve, InterpFunction, FName{ TEXT("doUpdate") });
	}
	MyTimeline->SetLooping(true);
	MyTimeline->SetPlayRate(1);
	MyTimeline->SetTimelineLengthMode(TL_LastKeyFrame);
	MyTimeline->PlayFromStart();
}

and add your update function

void UMySceneComponent::TimelineUpdate(float val) {		
 // do something
}
1 Like

Also, timelines support vector tracks:

3x static meshes, single timeline, single track. Each mesh does its own thing. And timelines can load a curve dynamically too.

You could use timers inside of components with an update function and take in a curve

Speaking of which, sampling a curve with a timer inside a component is a thing as well.

2 Likes

Thank you very much 3DRaven

I have taken screenshots of this.
Sooner or later I will have to convert my project to C++.

I know C++ well. But I started with BluePrints because I thought that this way I would learn to use Unreal faster. I think I did well because there is a lot to learn. I think I’ve been learning unreal for about 6 months now… I’m a complete newbie XD

I really appreciate your help!! :sparkling_heart: