GetTimeSeconds() vs TimeSeconds

How come GetWorld()->TimeSeconds works as well as GetWorld()->GetTimeSeconds() ?

I used the second version by accident whilst the video was paused, Is there a difference?

GetTimeSeconds() simply returns TimeSeconds.

I would opt for the getter as occasionally Unreal makes variables private and you would then have to refactor to the function.

For example in an earlier version of the course using UE4, USeneComponent::RelativeLocation was used and then in a later version that was made private which caused compilation errors when upgrading.

Thanks, I wasn’t sure if using the Getter was a slower/inefficient way.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms