Question about DeltaTime

I was messing about trying to do the final challenge and I realised that I couldn’t call OpenDoor() from inside BeginPlay(). The reason for this seemed to be that i had no way of passing in DeltaTime.

Does every function that uses DeltaTime as a parameter have to be called from inside TickComponent()?

Are there other ways to access DeltaTime? I’m sure there must be some cases when a function that uses DeltaTime wants to be called from inside BeginPlay().

You can get the delta time via GetWorld()->GetDeltaSeconds(). But I’m confused as to how that would help you in BeginPlay? What are you trying to do?

I can’t remember exactly, but at one point of testing, I thought that the door sound was either only playing the first time it opened, or only not playing the first time it opened, and so I tried to call OpenDoor() from inside BeginPlay() to see if that made any difference (I think I was trying to see if the trigger was part of the problem or not). It sounds like I could have used OpenDoor(GetWorld->GetDeltaSeconds()) in BeginPlay(), but I didn’t know this at the time.

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

Privacy & Terms