I have set up the aim offset for my character and it works nicely on the client that controls the character. However, if I look at the character from a different client, the aim offset isn’t working. It’s as if the Pitch isn’t being picked up by the other client. Screenshot for better clarification:
Ok, so I think I’ve found out why this doesn’t work in my case with multiplayer, but it does in ShooterGame example.
ShooterGame example uses a c++ function that is exposed to BP. It’s code uses a function called GetBaseAimRotation(), which has in it’s definition this:
// If we have no controller, we simply use our rotation
POVRot = GetActorRotation();
// If our Pitch is 0, then use RemoteViewPitch
if( POVRot.Pitch == 0.f )
{
POVRot.Pitch = **RemoteViewPitch**;
POVRot.Pitch = POVRot.Pitch * 360.f/255.f;
}
return POVRot;
In other words: there is no simple way of getting(afaik) the view rotation of remote clients using BP, which I need to offset the aim of the character on the other client…
Epic, could you expose this property to BP please?
Ok, so to close this problem, I finally solved it by using C++, by extending the Character class and reparenting my BP Character class to the new C++ extended Character class, to which I only added the GetAimOffsets function from ShooterGame’s character class.
The code for it is(in MyCharacter2.cpp):
No problem! I’m glad that I opened this thread so that people can see that there are still quite some things that blueprints don’t have access to and also how to solve this relatively important issue when it comes to multuplayer
Would it be sufficient to expose GetBaseAimRotation() to BPs as a BP callable func?
Also I think the check in the current engine code for using RemoteViewPitch only if the Pawn’s current pitch is zero is suspicious, I’ll probably remove that.
Thank you! Do you know by chance when these kinds of updates/changes get pushed to usable(official?) releases? Like when will I be able to use this(or other updates)?
This missed the timeframe for 4.4 which was just released, so it will be in 4.5. Not sure when that will be. In the meantime I would rely on the other options presented in this thread.
If you’re using GitHub source then changes are pushed the same day.