[BUG] Ability not reliably started on remote client


after upgrading to UCC 2.2.5 and PUN add-on 1.1.6. my ability is not started reliably on the remote client. When I try starting the ability on the local client the CanStartAbility is consistently called on the remote client, returning true. But the AbilityStarted method is sometimes called on the remote client, sometimes not. Before the upgrade this worked all fine.


Staff member
Are you able to tell me how to reproduce it from the demo scene of a fresh project?
Unfortunately, not. I tried the demo scene, but everything's fine. I am also using my own ability. Are there any methods where I can put debug messages to see where it derails after CanStartAbility?
I was able to track one issue down. In cases when it fails on the remote client, the moveEquipStarted parameter is set to true (in cases it works, it is set to false). So the system waits for the character to get to the MoveTowards location. But at the same time the transform is already synchronized via PUN and never reaches the MoveTowards position. As a result, the ability is never started on the remote client.


Staff member
Are you sure that previously worked? That portion hasn't changed in awhile. What is different about when the moveEquipStarted variable is true versus false?
Right now, I am a little lost. I reinstalled all Opsive components to be sure that I am on the latest version. Now I get another weird behavior. I enter my car on the local client. I use teleport to get rid of the animation stuff for the time being. The player on the remote client also enters the car. But in the next frame the player receives an SetPositionAndRotationRPC that forces the remote player to immediately exit the car again. Call stack on the remote client below.

I also saw that you changed the behavior of the standard drive ability in case of networking. But I don't understand your comments that the IDriveSource has to take over the notification of the remote players.

I think we need a diagram how the drive ability is supposed to work over the network. Then we can better trace issues. If you already have something, let me know, otherwise I will try drawing something from what I see in the code, and how I think states should be managed.

Vehicle exited BaseCharacterPUN(Clone)
Ai.Atnc.Car.VehicleRideAbility:OnExitedVehicle() (at Assets/_ATNC/Scripts/Car/VehicleRideAbility.cs:312)
Ai.Atnc.Car.VehicleRideAbility:WillTryStopAbility() (at Assets/_ATNC/Scripts/Car/VehicleRideAbility.cs:302)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:TryStopAbility(Ability, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1414)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:StopAllAbilities(Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:2250)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:SetPositionAndRotation(Vector3, Quaternion, Boolean, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1970)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:SetPositionAndRotation(Vector3, Quaternion, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1953)
Opsive.UltimateCharacterController.AddOns.Multiplayer.PhotonPun.Character.PunCharacter:SetPositionAndRotationRPC(Vector3, Quaternion, Boolean) (at Assets/Opsive/UltimateCharacterController/Add-Ons/Multiplayer/PhotonPUN/Scripts/Character/PunCharacter.cs:945)
System.Reflection.MethodBase:Invoke(Object, Object[])
Photon.Pun.PhotonNetwork:ExecuteRpc(Hashtable, Player) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:538)
Photon.Pun.PhotonNetwork:OnEvent(EventData) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:2156)
Photon.Realtime.LoadBalancingClient:OnEvent(EventData) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:3142)
Photon.Pun.PhotonHandler:Dispatch() (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:208)
Photon.Pun.PhotonHandler:FixedUpdate() (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:142)