I’m trying to write Dash() function that will move my character in some short period of time.
During this time I want to prevent my character form moving in different directions, jumping etc. so I want to disable input. I got UFUNCTION(Server,Reliable,WithValidation) specifiers over my Dash() function becouse I think it is quite important for gameplay and should be called on server.
So far I have Dash_Implementation that calculates final position of dashing, sets up timer that will call function to move player over some time and it works well.
I want to disable input in first lines of Dash_Implementation and enable it again when player reach final position.
Here is code i tried but it’s not working
#1
APlayerController* PlayerController = Cast<APlayerController, AController (GetController());
DisableInput(PlayerController);
#2
if (GEngine)
{
APlayerController* PlayerController = GEngine->GetFirstLocalPlayerController(GetWorld());
DisableInput(PlayerController);
}
Any ideas what’s wrong here?
Thanks in advance for your help
EDIT: i think the problem is that i disable input on server but clients can still move the player around