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.
asked Jun 14 '18 at 08:47 PM in Blueprint Scripting
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:
answered Jun 15 '18 at 04:54 PM
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.
answered Jun 14 '18 at 10:41 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here