x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

C++ Movement Network Warning

I'm using dedicated server in editor and auto connect. When I try to move my character using AddMovementInput, I get the following warning :

 LogProperty: Warning: Native NetSerialize StructProperty /Script/Engine.Character:ServerMoveNoBase.InAccel (ScriptStruct /Script/Engine.Vector_NetQuantize10) failed.

My character rotates down and left (not right nor up) and doesn't move, on all clients. If I don't use dedicated server, character's movement work on server but not on clients.

Attacks and jump works and are replicated fine everywhere, so the problem is really movement...

Here's my code for movement (wich is the base code) :

 void ASCharacter::moveForward(const float  Val)
 {
     if ((Controller != NULL) && (Val != 0.0f) && (canMove()) 
     {
         // find out which way is forward
         FRotator Rotation = Controller->GetControlRotation();
         // Limit pitch when walking or falling
         if (GetCharacterMovement()->IsMovingOnGround() || GetCharacterMovement()->IsFalling()) 
             {
             Rotation.Pitch = 0.0f;
         }
         // add movement in that direction
         const FVector Direction = FRotationMatrix(Rotation).GetScaledAxis(EAxis::X);
         AddMovementInput(Direction, Val);
     }
 }

 void ASCharacter::moveRight(const float  Val) 
 {
     if ((Controller != NULL) && (Val != 0.0f) && (canMove()) 
     {
         // find out which way is right
         const FRotator Rotation = Controller->GetControlRotation();
         const FVector Direction = FRotationMatrix(Rotation).GetScaledAxis(EAxis::Y);
         // add movement in that direction
         AddMovementInput(Direction, Val);
     }
 }

What's going on, why isn't the character moving ?

Thanks !

EDIT :

The warning problem seems to come from here :

Character.h line 240 - 250

 //////////////////////////////////////////////////////////////////////////
 // Server RPCs that pass through to CharacterMovement (avoids RPC overhead for components).
 // The base RPC function (eg 'ServerMove') is auto-generated for clients to trigger the call to the server function,
 // eventually going to the _Implementation function (which we just pass to the CharacterMovementComponent).
 //////////////////////////////////////////////////////////////////////////
 /** Replicated function sent by client to server - contains client movement and view info. */
 UFUNCTION(unreliable, server, WithValidation)
 void ServerMove(float TimeStamp, FVector_NetQuantize10 InAccel, FVector_NetQuantize100 ClientLoc, uint8 CompressedMoveFlags, uint8 ClientRoll, uint32 View, UPrimitiveComponent* ClientMovementBase, FName ClientBaseBoneName, uint8 ClientMovementMode);
 void ServerMove_Implementation(float TimeStamp, FVector_NetQuantize10 InAccel, FVector_NetQuantize100 ClientLoc, uint8 CompressedMoveFlags, uint8 ClientRoll, uint32 View, UPrimitiveComponent* ClientMovementBase, FName ClientBaseBoneName, uint8 ClientMovementMode);
 bool ServerMove_Validate(float TimeStamp, FVector_NetQuantize10 InAccel, FVector_NetQuantize100 ClientLoc, uint8 CompressedMoveFlags, uint8 ClientRoll, uint32 View, UPrimitiveComponent* ClientMovementBase, FName ClientBaseBoneName, uint8 ClientMovementMode);
Product Version: UE 4.19
Tags:
more ▼

asked Apr 05 '18 at 08:23 PM in C++ Programming

avatar image

Amneri
131 3 6 15

avatar image Amneri Apr 10 '18 at 01:17 PM

I can't fix this problem... Any help ?

avatar image Amneri May 06 '18 at 10:30 AM

Still isn't solved. I can't move client characters. Any help ?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Finaly solved it.

I was trying to make instant rotation to my character.

Changing

 MovementComponent->MaxAcceleration = 3.40282e+38f;

in my constructor to

 MovementComponent->MaxAcceleration = 3.40282e+4f;

Solved it.

more ▼

answered May 10 '18 at 06:42 PM

avatar image

Amneri
131 3 6 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question