How to use GetGameTimeInSeconds?

I am trying to call UKismetSystemLibrary::GetGameTimeInSeconds(this) in a function of a class that inherits from AActor, but I get the C2355 error below.

error C2355: ‘this’ : can only be referenced inside non-static member functions or non-static data member initializers

How can I pass the UObject* WorldContextObject to the function without using ‘this’?

Hello Farshooter,

UKismetSystemLibrary::GetGameTimeInSeconds(this) It is only for blueprint.

Try to use this

GetWorld()->GetTimeSeconds();

Hope it helps!

Thanks . This was exactly what I was looking for.