Hello,
I am new to Photon and have wrapped up my Project to use the basics of PUN 2 by now.
My Problem is the following:
You can think of games like Diablo 3 and Path of Exile, basically Action RPGs.
I have a Character which has a set of abilities. When the local Player uses this ability the following RPC-Command should be sent to the network, so that this specific GameObject of the player performs the animation, which is stored in the Ability itself using a AnimatorOverrideController. The GameObjects of other Players also have the AbilityComponents of that player.
//Called like this
photonView.RPC("playAnimation", RpcTarget.Others, abilityIndex, target, player.photonView);
[PunRPC]
private void playAnimation(int abilityIndex, Vector3 target, PhotonView view) {
abilities[abilityIndex].Use(target);
}
An ability is split into two parts:
- The Ability Config (Scriptable Object)
- The Ability Behaviour, which is added in runtime to each Player according to his selected Abilities