PunAnimationMonitor SetPitchParameter

Zaddo

Active member
When idle in first person mode, the SetPitchParameter sets the dirtyflag all the time. This is because the main camera gameobject is matching the idle animation movement in first person. Third person doesn't have this issue because the camera doesn't match the idle movement.

There is no tolerance on the pitch value change triggering the dirty flag. As a result the animation monitor continuously sends packets when the player is idle in first person.

I am not sure how to fix this. Setting the dirty flag should ignore the movement due to the idle animation. Just setting a tolerance would make the pitch step whenever it exceeds the tolerance and not be smooth.

Is there some way to negate the idle animation movement in the Pitch value for PunAnimationMonitor?
 
Maybe I could add a threshold for when the pitch (and yaw) value get sent. This would give you the option of deciding how often you want it to add to the traffic load.
 
Hi Justin,
Thanks for the reply. I know I am going to regret doing this because it will make taking updates more difficult, but I changed the base classes of UFPS to fix the issue. This is working really well. I just added another property that returns the Pitch without the camera movement.

Would you consider making a similiar change to your code? Selfishly, this would allow me to return to base code. But I think it is better for all as it reduces network traffic.

- Add property PitchRaw to ILookSource interface
- On the CameraController class add property PitchRaw as follows:
public float PitchRaw { get { return m_ViewType.PitchRaw; } }
- Add Abstract property PitchRaw to ViewType base class
- On FirstPerson class override PitchRaw:
public override float PitchRaw { get { return m_Pitch - m_Shake.y; } } // Pitch without the camera movement
- On all other classes that inherit from ViewType, set PitchRaw to same as Pitch
- Change UltimateCharacterLocomotion.UpdateAnimator to use m_lookSource.PitchRaw instead of m_LookSource.Pitch
 
Last edited:
That change has some impacts on non-remote players so at this point I'd like to come up with a better solution. I've written it down to take a closer look at this.
 
Top