There is an offset of about 90 degrees between where the player is looking from other players perspective and where their screen is showing. For example if you are looking North, the other players will see you as looking east. When click W to move forward you will move forward according to where other players see as your direction (East) and from your perspective it will look like w is moving you right.
I have the camera visible for debugging and even the camera from other players perspective shows them looking east when they are looking north. Also this offset occurs once the player uses their mouse to look up and down. If I disable looking vertically everything works fine, but even a tiny input from the vertical component of the mouse and there is a permanent offset.
This is only happening in a particular level in other level the turning and movement is working fine but I am using the same code for both so I don’t know why it isn’t working on this particular level. The only difference is the mesh on this level (the offset one) has its x y z coordinates wrong for the mesh. The mesh’s x direction is in the y direction of other components. (This is why I have it plug into the roll instead of pitch.)
This used to work fine I haven’t worked on this level in a few months since then the only change to it should be some engine upgrades so I don’t understand how this could have started
(Also I will eventually move this to an aim offset on the spine instead of rotating the mesh)
When you apply pitch rotation to the mesh (via Roll due to your axis mismatch), you’re rotating the root component of the mesh itself. This means the mesh’s forward vector is now rotated, so when the engine calculates the actor’s facing direction for replication and movement, it reads from the mesh’s transformed orientation, giving you that 90° offset.
The other level likely has a mesh whose axes are aligned correctly, so pitch → Y (Pitch pin) works normally and doesn’t disturb the forward vector. Your workaround of routing to Roll was masking the axis problem but introduced this side effect.
I can think in two different fixes for this issue:
A) The mesh should never be rotated to handle up/down camera movement. Instead:
Attach a Spring Arm component to your capsule.
Let the Spring Arm handle camera pitch by enabling “Inherit Pitch” on it (or drive its relative rotation with your pitch value).
Attach your Camera to the Spring Arm.
Leave the mesh rotation completely alone for vertical look.
This way the mesh’s forward vector is never touched by mouse input, so movement, replication, and facing direction all stay correct. As a bonus, this is also the standard setup for moving the camera to an aim offset on the spine later.
B) (Use this option if you NEED to rotate the mesh) Instead of compensating the rotation by routing pitch into the wrong pin, fix the mesh’s default orientation so its axes line up correctly with the rest of your components:
Select the Skeletal Mesh component in your Blueprint.
In the Details panel, and adjust the default relative rotation to re-align the mesh (usually rotating Z by +90° or -90° until the mesh’s forward axis matches the actor’s forward axis).
Once the mesh is properly aligned, route your clamped pitch value back into the New Rotation Y (Pitch) pin of Set Relative Rotation like normal, and set Roll and Yaw back to 0.
This fixes the problem at the source rather than working around it with the wrong pin, and your movement and replication will behave correctly again.
And that’s it! One of these options should solve the problem!
Let me know if it works or if you need more help with it!
I am trying to rotate the mesh if I understand what you’re saying its just rotating under transform tab in the details panel. I had already done this but the coordinates for the character are still wrong.
Below is when I click on the character vs any other component for the blueprint they are facing the same way but the X Y coordinates are switched. My character is facing the positive y coordinate according to the mesh but all the other components and the overall blueprint sees it as facing the x direction. It may be hard to see but you can also see the world y direction through the green grid line under the character.
But if you really need to rotate the mesh only, the easiest way to solve your issue is to add a Scene to your BP components and then make your mesh child of that Scene. Then rotate the scene instead of the mesh itself.
Hi thank you so much for the step by step instructions I really appreciate it. I tried the using the scene rotating with the the mesh as a child. However rotating the scene in the y direction will rotate the mesh in its local y direction which would be the x direction. This means the camera and local player will be looking in the right direction however mesh will rotate in the x direction in reference to the actor (the mesh rotates looking like its floating in the air and lying on its side and 90 degrees). However implementing what you said made me realize that I had some settings wrong in the replication plugin (Smooth Sync)
I am using, (this plugin is the reason I have to do this rotation in this way to begin with). It showed me the meshes local axis is the issue, I have to reimport the mesh with some different settings as blender and unreal can have different facing y axis.
Even though the scene component didn’t work for me, it helped me realize the solution and I am grateful to the effort you put into the responses. Thank you.
So I fixed the x and y orientations being off for the skeletal mesh, it was being caused by a placeholder animation class I was using for this character. For some reason it was rotating the mesh by 90 degrees causing the issues.