ConstructorHelpers::FObjectFinder not working

I’m trying to use ConstructorHelpers::FObjectFinder in my constructor to get a UCurveFloat reference, but I’m getting lots of errors. Here is the code I’m using:

static ConstructorHelpers::FObjectFinder<UCurveFloat> CurveToMidPoint(TEXT("Game/Curves/CurveToMidPoint.uasset"));
IntermediateCurveToMidPoint = CurveToMidPoint.Object;

Here are the errors Visual Studio is throwing:

'ConstructorHelpers': is not a class or namespace name
syntax error: missing ';' before '<'
missing type specifier - int assumed. Note C++ does not support default-int
'CurveToMidPoint': undeclared specifier
left of '.Object' must have class/struct/union

Since these errors all disappear when I comment out these two lines, they are causing all of them.
What am I doing wrong?

Are you using this?

#include "Runtime/CoreUObject/Public/UObject/ConstructorHelpers.h"

Ah, that’s it. Thanks! Very new to C++.

However, while this now builds, it’s not actually working. When I look at the BP version of this class, the curve asset hasn’t appeared in the variable. I’m pretty sure the path and name are correct, so I can’t figure out what I’m doing wrong. Any suggestions how to track it down?

Did you right click on the curve and saved the reference instead of tracking down the path of your asset? If that doesn’t work, what type is “IntermediateCurveToMidPoint”?

Nope, I didn’t even know about that. That was all I needed to do.
It needed to be ‘CurveToMidPoint.CurveToMidPoint’ not ‘CurveToMidPoint.uasset’
Thanks so much for your help!