jhirsh:
Sorry you are probably sick of me by now. I have been wrestling with this for a couple of days and I just can’t figure out the source of my issue here.
Some background on my setup:
Using MoveIt plugin for character movement. *this may or may not have bearing on my issue
This is a first person project so my character has a separate 3rd person model and 1st person.
The camera is tied to this first person view model.
I am currently manually synching the camera pitch via SetWorldRotation in replicated events based on player input in blueprint.
This is using PIE Listen server with 2 players.
What I am seeing:
When I use an ability that uses the Camera as source for a raycast or spawn actor the raycast & spawn ent both work as expected. However the client will see the raycast and spawned entity but at the default pitch of the camera rather than the updated angles.
The camera & viewarm pitch appear to update for the client and server as expected.
What I have done:
I have ensured that neither of my raycast or spawn entity have an overridden Binding on location.
Realm is set to Client And Server
I have created multiple abilities to ensure it wasn’t some kind of data corruption
Tried a couple half cocked work arounds like making my 1st person gun an actor with an able component. Couldn’t figure out how to link an actor to an actor efficiently, but may go back to this method to see if i have better luck.
I don’t know much about network replication in Unreal so I’m struggling to find a good way to debug the actual source of this issue. If you have any pointers here I would greatly appreciate it.
Thanks much,
Jordan
You may need to make sure your Player Controller is sync’ing pitch. The Camera Target Type uses the following code (you can place a breakpoint in ablAbilityTypes.cpp if you want to step through things):
if (m_Source == EAblAbilityTargetType::ATT_Camera && !TargetActor->IsA<ACameraActor>())
{
FVector ActorEyes;
FRotator ActorEyesRot;
TargetActor->GetActorEyesViewPoint(ActorEyes, ActorEyesRot);
OutTransform = FTransform(FQuat(ActorEyesRot), ActorEyes);
}
So likely GetActorEyesViewPoint (which uses the controller pitch/rotation IIRC) isn’t returning what you expect.