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"

Replicating Component Pitch Rotation 360 degrees

Hi, i'm currently building a space battle multiplayer game.

I currently have a pretty okay system going on, multiplayer joining/leaving works etc, movement is replicated, shooting is replicated.

And using Controller Yaw input, turning left and right is working.

My issue however, is that in my game I want the player to be able to essentially fly upside down.

I have tried using normal rotation, and that works perfectly for the user, but it isn't replicated visually As is seeable in this Screenshot.

although player 2 (on the right) is upside down, the server (on the left) can't see that they have gone upside down

alt text

Alternatively i tried to use the same solution for turning sideways, by using Controller Pitch input, however that reaches a breaking point when i go over 90 degrees up or down, because after that it wants to twist my character around. And as a result back forward, and then back repeatedly.

Essentially compressing the player into a singularity like so alt text

Hence my question, can anyone help me solve this issue and get me to replicate pitch rotation so i can fly upside down?

My main issue is really that i'm not that familiar with replication as i've only just started applying multiplayer,

Any additional helpful information i can think of: My rotation is achieved by having the Ship-model component Look at the location of the crosshair. And then use Finterp to "smoothly" rotate the character to match the direction. So: crosshair is to the left of the player, player smoothly rotates to the left, same with right If the crosshair is above the ship, the ship rotates upward, same with downward.

Product Version: UE 4.19
example1.jpg (171.0 kB)
example2.png (738.4 kB)
more ▼

asked Jun 14 '18 at 08:47 PM in Blueprint Scripting

avatar image

31 1 6

avatar image mightyenigma Jun 14 '18 at 09:20 PM

I have a question first: Is the way you're controlling pitch having some of the same problems even when there is no networking going on?

You may be suffering from Gimbal Lock.

What is the base class your spaceship Pawns inherit from, and what kind of Movement components (if any) do they have/use?

avatar image Dr.Wol Jun 14 '18 at 09:58 PM

Using the pitch controller generates it outside of networking too yes. Hence i started using the add local rotation to update movement as i started, but that doesn't replicate.

The pawns originally inherit from the standard character actor, using the inherited movement component that contains. And i made sure to set that to always be in the "flying" state of that movement component

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

2 answers: sort voted first

I'm just going to leave this here for any future people that encounter this issue.

I found a solution, which is to literally have the server replicate the position of said ship after the client set it And for the client to replicate the same if the server (authority) does it. This fixed replication, although right now the clients movement starts to try and push away from nearing pitch 90 degrees.

This should be fixable though with a bit more tweaking, the main thing is that i now have replicated rotation

alt text

The End result: alt text alt text

answer.jpg (165.7 kB)
ships.png (1.7 MB)
ships2.jpg (127.5 kB)
more ▼

answered Jun 15 '18 at 04:54 PM

avatar image

31 1 6

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

Character classes are designed for vertical biped characters and might not allow you to flip upside down - but maybe they do, I havent tried it.

The rotations on most U real actors are stored as Euler rotators which may suffer gimbal lock when you can rotate more than a 179.999 degree arc on more than 1 axis at a time.

I'm not sure if thats the problem or if its the use of character class. Character class is the only thing with built in network prediction and smoothing though so hopefully you can still use it.

if it is gimbal lock, then add your current Rotation to the A pin in a Combine Rotators node, and the additional rotation offset you are adding onto it in the B pin, then use the output pin of that as your new rotation.

Combine rotators internally converts euler rotators to quaternikns which dont gimbal lock, then outputs another euler i think so give that a try and let me know if it improves anything.

more ▼

answered Jun 14 '18 at 10:41 PM

avatar image

3.7k 18 23 20

avatar image Dr.Wol Jun 14 '18 at 11:34 PM

I tried using the Combine Rotators, sadly it didn't change anything,

But i think you misunderstand my issue, i may have wrongly explained when i said the pitch controller spazzes out in single player too.

I have 2 options to go with,

  1. If i use alt text

This pitch rotation IS replicated, but THEN i get that freakout moment regardless of singleplayer/multiplayer etc, because it starts flipping around, probably because as you said, the character class probably isn't meant for flipping upside down.

So its either fix that or: 2. My own solution is having the base capsule rotate around the Z axis (left and right) and rotating the Mesh around Y axis

This solution works on the client side, i can flip upside down and back np, fly in all directions . But the Y rotation of the mesh isn't replicated.

So my issue isn't that the rotation is not working, it's that other users don't see it happening across the Y axis.

I hope that explains it a bit better.

And thank you for your quick responses, i'll check in tomorrow if theres more replies (its 1:31 at night right now)

control-pitch.png (22.3 kB)
avatar image mightyenigma Jun 15 '18 at 04:13 AM

hm i see. I wonder if there is another way to replicate pitch to clients

(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