[Bug] Segregation of duties for synchronizing state between Drive ability and IDriveSource (UCC2.2.5 / PUN-Add-on)

ChristianWiele

Active member
Hi,

with the upgrade to UCC 2.2.5 the IDriveSource is supposed to synchronize the car state. But with the code changes some calls to the Drive ability and the CharacterLocomotion are not executed on the remote client (see highlighted lines below). To have a clear separation these calls should be performed by the Drive ability, and not by the IDriveSource (which would require a reference of the IDriveSource to the player.

Bildschirmfoto 2020-08-22 um 18.15.08.png
 
Your IDriveSource should now be making those calls directly on the vehicle object. The CharacterLocomotion states are not used on remote players so those do not need to be set. The animator controller is also synced through the PunAnimatorMonitor so the DriveState does not need to be set on the remote player.
 
O.k. wasn't sure what is required on the remote client. Still the Physics.IgnoreCollider calls need to be synced (see comment in my other thread.

You need to add the local player check in the AbilityStopped() method. Otherwise it will throw an error on the remote client.
 
Top