GetScript from UNiagaraEmitter not working?

Hello!

I am starting out with UE5.

In the documentation for UNiagaraEmitter (link) I see that there is a function ‘GetScript’ which I am trying to call like this -

“UNiagaraEmitter* NiagaraEmitter = EmitterHandle.GetInstance().Emitter;”
“UNiagaraScript* Script = NiagaraEmitter->GetScript(ENiagaraScriptUsage::ParticleUpdateScript, FGuid());”

But I can’t compile the code because of compile errors -
‘error C2039: ‘GetScript’: is not a member of ‘UNiagaraEmitter’’

I can clearly see the GetScript function in both NiagaraEmitter.cpp and NiagaraEmitter.h files. My NiagaraEmitter also compiles correctly, because I have a log message beforehand which checks that the NiagaraEmitter is not nullptr and prints it’s name.

Am I doing something wrong or what’s going on here?