# How to Make a Function that Convert Runtime Float Curve into a Float Curve object

**URL:** <https://forums.unrealengine.com/t/how-to-make-a-function-that-convert-runtime-float-curve-into-a-float-curve-object/1317791>\
**Category:** C++\
**Tags:** unreal-engine, runtime, curve, CPP\
**Created:** [September 30, 2023, 3:41pm UTC](https://forums.unrealengine.com/t/how-to-make-a-function-that-convert-runtime-float-curve-into-a-float-curve-object/1317791 "2023-09-30T15:41:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GGUMINGUUU](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GGUMINGUUU](https://forums.unrealengine.com/u/GGUMINGUUU)\
**Post date:** [September 30, 2023, 3:41pm UTC](https://forums.unrealengine.com/t/how-to-make-a-function-that-convert-runtime-float-curve-into-a-float-curve-object/1317791/1 "2023-09-30T15:41:37Z")

</div>

Hello there , Im trying to find a way to convert a Runtime Float Curve into a Float Curve ( which could be used as to the Set Curve to a Timeline. I’m not a pro on unreal C++ ; so i suck at this early time

here is so far i did and error im facing

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/d/4cd942ebd237abe06ee1c19c850f233ae41e2be9.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/e/3/7e367ae5f88b202558fafcc53945fb4a6d52147d.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/0/d/60d6f06ceccddcfe7faeeaed14982216eb3ce436.png)

---

<div class="post-metadata">

**Author:** ![STRiFE.x](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/strife.x/32/969826_2.png) [@STRiFE.x](https://forums.unrealengine.com/u/STRiFE.x)\
**Post date:** [December 27, 2024, 1:35pm UTC](https://forums.unrealengine.com/t/how-to-make-a-function-that-convert-runtime-float-curve-into-a-float-curve-object/1317791/2 "2024-12-27T13:35:17Z")

</div>

You can create a curve asset at runtime.

```auto
UPROPERTY(EditInstanceOnly, Category = "Timeline")
FRuntimeFloatCurve Curve;

UPROPERTY(Transient)
TObjectPtr<UCurveFloat> CurveAsset;

```

```auto
void AMyActor::PostInitializeComponents()
{
	Super::PostInitializeComponents();

	if (GetWorld()->IsGameWorld())
	{
		UCurveFloat* NewCurve = NewObject<UCurveFloat>(this, NAME_None, RF_Transient);
		NewCurve->FloatCurve = *Curve.GetRichCurve();
		CurveAsset = NewCurve;

		TimelineComponent->AddInterpFloat(CurveAsset, FOnTimelineFloatStatic::CreateUObject(this, &ThisClass::OnTimelineFloat));
	}
}

```
