I was testing the game with a client and a server with 2 players. From the server’s point of view everything is fine. However from the client’s point of view there appears to be a bug where the character mesh falls into the floor when crouching. Then once the character jumps, the mesh stops going into the floor when crouching and looks correct.
I tried messing around with the CharacterMovement->bCrouchMovesCharacterDown variable a bit with nothing helping. I even did some debugging to see if it was set to false initially somehow, but it’s true at all times if the character is in Walking move mode. I found the code that sets this too.
Maybe I’m missing something, but I have a feeling this might actually be a bug in the CharacterMovement implementation.
On a slightly unrelated note, my character is able to crouch while mid air, and the bCrouchMovesCharacterDown still seems to happen. I was excited for a second thinking we get Halflife style crouch jumping built right in since I plan on adding that myself, but when I enabled show collision in the console, I could see the capsule was aligning down to where the floor would be if the character was standing, rather than aligning to the top of the character. This makes me think that there should be default behavior that actually prevents the crouch from happening while in midair.
I have an update on the issue. I think the issue is that the player running the server doesn’t have its mesh properly updated, while clients do.
When I check the “Run Dedicated Server” checkbox under the play button, both windows in the 2 player game should be clients.
So now there’s a dedicated server in the background.
Both clients have the correct behavior. The mesh doesn’t go into the ground. But when I uncheck the box again so that the main level viewport is the server, I get the same broken mesh going into ground behavior.
Then I tried with 3 players. When I have a checkbox checked for dedicated server, all 3 players show the correct behavior. When I have it unchecked, only the server player sinks into the ground from the point of view of the clients. The client players properly replicate their crouching to each other.
It appears that this code in Character.cpp is supposed to handle the mesh position readjustment.
void ACharacter::OnStartCrouch( float HeightAdjust, float ScaledHeightAdjust )
Mesh->RelativeLocation.Z = GetDefault<ACharacter>(GetClass())->Mesh->RelativeLocation.Z + HeightAdjust;
BaseTranslationOffset.Z = Mesh->RelativeLocation.Z;
BaseTranslationOffset.Z = GetDefault<ACharacter>(GetClass())->BaseTranslationOffset.Z + HeightAdjust;
@illYay : Were you ever able to fix the issue?