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"

Pitch & Yaw replication issue

Hi, i just moved my pitch & yaw calculations from my animation blueprint to my c++ character class. The server can see the client's yaw and pitch updating, but the client cannot see the server's yaw and pitch updating. Here's the pitch & yaw calculation into my character's tick function:

     FRotator rPitchYaw = UKismetMathLibrary::RInterpTo(FRotator(Pitch, Yaw, 0.0f), UKismetMathLibrary::NormalizedDeltaRotator(GetControlRotation(), GetActorRotation()), DeltaTime, 15.0f);
     if(UKismetMathLibrary::ClampAngle(rPitchYaw.Pitch, -90.0f, 90.0f) != Pitch)
     { 
         SetPitch(UKismetMathLibrary::ClampAngle(rPitchYaw.Pitch, -90.0f, 90.0f));
     }
     if (UKismetMathLibrary::ClampAngle(rPitchYaw.Yaw, -90.0f, 90.0f) != Yaw)
     {
         SetYaw(UKismetMathLibrary::ClampAngle(rPitchYaw.Yaw, -90.0f, 90.0f));
     }
 

And there are the declarations inside the character's header file

 UPROPERTY(Transient, Replicated)
     float Pitch;
 
     UPROPERTY(Transient, Replicated)
     float Yaw;
 
     void SetPitch(float value);
 
     UFUNCTION(Reliable, Server, WithValidation)
     void ServerSetPitch(float value);
 
     void ServerSetPitch_Implementation(float value);
 
     bool ServerSetPitch_Validate(float value);
 
     void SetYaw(float value);
 
     UFUNCTION(Reliable, Server, WithValidation)
     void ServerSetYaw(float value);
 
     void ServerSetYaw_Implementation(float value);
 
     bool ServerSetYaw_Validate(float value);

and then the functions:

 oid AULCharacter::SetPitch(float value)
 {
     Pitch = value;
 
     if (Role < ROLE_Authority)
     {
         ServerSetPitch(value);
     }
 }
 
 void AULCharacter::ServerSetPitch_Implementation(float value)
 {
     SetPitch(value);
 }
 
 bool AULCharacter::ServerSetPitch_Validate(float value)
 {
     return true;
 }
 
 void AULCharacter::SetYaw(float value)
 {
     Yaw = value;
 
     if (Role < ROLE_Authority)
     {
         ServerSetYaw(value);
     }
 }
 
 void AULCharacter::ServerSetYaw_Implementation(float value)
 {
     SetYaw(value);
 }
 
 bool AULCharacter::ServerSetYaw_Validate(float value)
 {
     return true;
 }

Then i simply get the pitch & yaw in the animation blueprint's event blueprint update animation. I replicate my others variable the same ways and they work well, i don't get why this happens. thank you in advance for your help.

Product Version: UE 4.17
Tags:
more ▼

asked Aug 17 '17 at 08:52 PM in C++ Programming

avatar image

Holiska
40 3 5 9

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

1 answer: sort voted first

Still looking for an answer, i'm going to move it back to the anim blueprint temporary untill i find an answer.

more ▼

answered Aug 18 '17 at 11:21 AM

avatar image

Holiska
40 3 5 9

(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