I’ve been struggling with this one the entire day now, hoping someone can give some clue.
So I have a character blueprint with a “character movement” component and a camera inside. Player is “facing away from the camera” originally (3D compatible controller), but I’m doing a 2D sidescroller (all working fine) but I just need to have the initial rotation set to +90 degrees (so you don’t see the “side” of a sprite when it’s spawned. Sound trivial (just rotate the Actor) but in a multiplayer setting it messes in some unexpected way with the camera rotation.
- Replication is disabled for the camera - so it should not care about replicating position/rotation
- First thing done is detaching the camera from the Actor ( a custom CameraMovement component will handle following the Actor) so again changing position/rotation of the Actor should be irrelevant to (the now) detached camera.
So when running it first hits the breakpoint in UCameraMovement::BeginPlay on the authority - which is fine. It does the detach and basically changes the position a bit (mainly distance from the Actor). Rotation is 0,0,0.
next we hit the following breakpoint in the blueprint - again through the “authority” path (so on the server) which then changes the Actor rotation Z/Yaw to 46 degrees (some recognizable number, actual value is irrelevant) - all fine so far.
Then we hit the UCameraMovement::BeginPlay on the not-authority (so client)… At this point, weirdly enough the relative rotation of the camera is 46 degrees… So how did that get changed?!
I can see the Actor is turned by 46 degrees (which is expected) - but the detached(!) camera which is not(!) replicated is now also rotated by 46 degrees (confirmed because it actually looks in a 46 degree rotated angle on my scene)… I don’t understand why?!
Any ideas? (Even if just how to catch it the exact moment when it happens?)