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

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

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.

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?

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

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.

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

244345-control-pitch.png

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)

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

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

The End result: