Syncing IK (AimIK)

Options
I have setup an IK for the player model which works in client side. How do I sync it for other players to see. I know AdvancedTutorial already has an example of IK, but here I am using AimIK which comes from the FinalIK package.

Do I need to sync the bones transforms I added in AimIK? If so, then how? Like creating different states with Transform added for each bone?

My player movement and rotation are completely non-authoritative btw.

Comments

  • SpectraS7
    SpectraS7
    edited November 2018
    Options
    I fixed it!

    All I need was to sync the location of aim target of the aimIK on the network.
    I added a empty object called "LookAtTarget" as a child of camera singleton prefab which is spawned per player.

    Then I added a new Vector3 property in the Player state of bolt assets. In PlayerMotor (mine is non-authoritative) I sync the location of "LookAtTarget" to that Vector3 property.

    Later I added a new child object called "LookAtPrefab" to player prefab. Then I write the script which access the aimIK and change the location of "LookAtPrefab" according to the Vector3 property of player state and finally set "LookAtPrefab" as aim target of AimIK and done.

    Hope this will be useful to future readers.
  • Arnesso
    Options
    Thank you Mate ...=)
    I literally almost overwrite my whole IK :D You saved some days for me.. I have thought everything... but the most obvious thing does not come into my mind :D
  • Komrade
    Options
    This is how I set it up, however I'm using both an AimIK and a LookAtIK (both from finalIK) and while the AimIK works fine, the HeadLookIK seems to be preventing the player from moving or rotating! it was working fine before I added photonview objects to it (and it was actually working fine in earlier iterations of my networked character), but now the character can't move or rotate so long as the LookAtIK is enabled