How to tick playercontroller variable properly

Hi all,

Sorry if the formatting is a bit funky on this question, I am posting on mobile.

I wanted to know the best way to tick a player controller - it doesn’t seem to have its own tick function, and it’s storing a time variable which I am using to store a synchronised server time on client side (as the default is too inaccurate for my purposes), which synchronised on an initial handshake on player connect. whilst it synchronised on the handshake it doesn’t then update with real-time, and I assume I have to add delta time to the time on a tick.

How would I tick this variable with delta time, when it is stored on a player controller?

Thanks in advance for your help

player controllers inherit from AActor so they certainly do have a tick event. you can override it with

virtual void Tick(float DeltaSeconds) override;

EDIT:

Not sure if controllers have their tick disabled by default? Might be worth setting
bCanEverTick in the constructor to be sure

2 Likes

Oh ok, that’s easier than expected then, thanks. The presence of the other tick function for player input confused me.