Krazy Karts from Unreal 4 Multiplayer Master on UE5 and Enhanced Input

PROBLEM:
Just wanted to let anyone that is searching for an answer to a similar problem I had that there is an answer! The problem was that when opening the provided Krazy Karts uproject, I could get to about the Server Functions and Cheat protection section before things weren’t working, while using Enhanced Input.

First problem I had was that for some reason, whenever you started the game as a listen server with two characters, the character on the server seemed to have its pawn be unpossessed and you couldn’t control the car.

The second problem was that the client would not move on the server, even though the bindaction functions had ‘UFUNCTION(Server, Reliable, WithValidation)’ attached to it.

SOLUTION:

Fixing the first problem had me pretty much remaking the project from scratch, opening unreal engine and creating a new project, and then copying the code and stuff over, if you got stuck at the same point I did, it’ll take you maybe 20 or so minutes! That stopped the unpossessing of the pawn on the server.

The second problem had me making a wrapper function, as it seems that the “const FInputActionValue& Value” in the input of the function you use for BindAction was just not properly being sent over the network maybe. But what fixed it is, when calling the BindAction function, pass in a normal non-RPC function, and have the “const FInputActionValue& Value” as the input for the function as normal.

Then in the non-RPC function, have it call the RPC function using the actual value of the FInputActionValue (in my case, float). Don’t forget to add the mapping context as well! I’ll post some screenshots below! Hope these help save you the day or two it took me to figure it out!

SetupPlayerInputComponent function:

The functions at hand:
image

The function headers in the .h file:
image

You wouldn’t actually send the input to the server directly anyway so what you have is 100% correct. It depends on where you are in the course as eventually you send a chain of updates which are played back to each client. This has pretty much a retired course now but there are interesting things to learn. I wouldn’t spend too much time worrying about the input system here.

For sure! Just got to where there was a wrapper function that was wrapped around the RPC anyways for the autonomous proxy to set its own variables! And makes sense why I couldn’t find the course on gamedev.tv if it was retired! Though still super helpful!! So far, it doesn’t feel that a lot has been changed, and it’s nice to be able to go back and look through UE4 too in case there’s ever a time where I’d have to work on UE4 anyways!

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