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"

RemoteViewPitch is always zero

We're designing a first-person multiplayer game, and we want our pawns to look with their heads into the direction they are actually looking. For this, we looked into the ShooterGame example, and noticed that they make use of the replicated property:

 APawn::RemoteViewPitch

The problem we have, is that no matter what we do, this value is always zero on all clients. When a player looks up with the mouse, we call:

 APlayerController::AddControllerPitchInput(float Val);

Which updates the rotation of the controller, located at

 AController::ControlRotation

This property is not replicated. However, we expect the controller to set the RemoteViewPitch for us. Now inside APawn, we spotted this:

 void APawn::Tick( float DeltaSeconds )
 {
     Super::Tick(DeltaSeconds);

     if (Role == ROLE_Authority && GetController())
     {
         SetRemoteViewPitch(GetController()->GetControlRotation().Pitch);
     }
 }

Apparantly the server updates the replicated pitch value. However, for that it uses a struct that is not replicated! And now the weird part is, this pitch apparantly does get updated in ShooterGame. We've compared our code with the ShooterGame's code, and we cannot figure out why it isn't working for us. We can't find any hidden booleans we have to toggle on, or any other properties related to this.

Product Version: Not Selected
Tags:
more ▼

asked Jul 28 '14 at 06:44 PM in C++ Programming

avatar image

Shammah
380 23 18 144

avatar image Marenz Jul 29 '14 at 10:52 AM

One thing to add: The server it self does seem to receive the correct value, not so any client though.

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

1 answer: sort voted first

Problem solved. We overrode the APawn::Tick function and didn't call the super function which would set RemotePitchView.

more ▼

answered Aug 01 '14 at 10:26 PM

avatar image

Marenz
18 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