I'm getting some really odd behaviour with my PlayerController states. If my PlayerWalking state in the PlayerMove function I check a bool to see if it's true. If it is, I switch to a different state called PlayerOnLedge. This is where it gets weird. If I put log functions in my BeginState and EndState functions in the PlayerOnLedge state I see that my PlayerController is constantly entering and exiting out of the PlayerOnLedge state.
Note, that I have checked many times and I don't have any other code that makes the PlayerController change state. This only happens when I am connected to a dedicated server. Also, I checked and the server is still in the PlayerWalking state while the cilent is in the PlayerOnLedge state. Of course, if I switch to a standalone game, the constantly entering and exiting of PlayerOnLedge stops.
Also, after further playing around I got this to stop if I switch PlayerController on the client and server to the same state by calling GoToState in a unreliable server function.
I don't quite understand why this is happening, can anyone shed some insight? Is calling GoToState on the client and server correct to sync the overall state of the PlayerController?
Note, that I have checked many times and I don't have any other code that makes the PlayerController change state. This only happens when I am connected to a dedicated server. Also, I checked and the server is still in the PlayerWalking state while the cilent is in the PlayerOnLedge state. Of course, if I switch to a standalone game, the constantly entering and exiting of PlayerOnLedge stops.
Also, after further playing around I got this to stop if I switch PlayerController on the client and server to the same state by calling GoToState in a unreliable server function.
I don't quite understand why this is happening, can anyone shed some insight? Is calling GoToState on the client and server correct to sync the overall state of the PlayerController?
Comment