Synchronize IK

Options
Hi everyone! I am wondering how to sync IK over the network. When I instantiate my gun, an IK script takes the gameobjects of that gun to position the hands. It works on the local client, but I don't know how to make other clients see the IK. Does someone know how to achieve this?

Thank you in advance!

Comments

  • Spaggi
    Options
    I did that by synchronizing transforms where the IK is assigned to. Can't say if this is possible in your use case.
  • jeanfabre
    Options
    Hi,

    What you need is to synchronize the end Effector the IK Chain, that's all you need ( if you don't have a History dependant IK solver, but I think that's the case for you).


    Bye,

    Jean
  • Steeven
    Options
    Thank you for your answers! But I am not sure to understand what you mean by "end Effector th IK chain". I tried to put a Photon View synchronizing the transform of the bones but it didn't work.
  • Steeven
    Options
    I am gonna try to explain what I want to do. When a player change his gun, a new gameobject is instantiated in the player hierarchy. In that gameobject, there are the gun model, and empty gameobjects that located the hands and lookat positions. When the gun is instantiated, the ik script search in the hierarchy and assigns the empty gameobjects as hands positions (search with tags). It works for the local player, but the others can't see the ik. I tried to put a gun and assign the hands positions in the prefab(no gun changing) and it works, so the problem is that other players don't know what gameObject is assigned as hands positions. I tried to sync those but it never worked. I hope I have been clear in my explanation.

    Thank you in advance!
  • Steeven
    Options
    I finally solved my problem. I created 3 gameObjects (RiaghtHand, LeftHand and LookAt) in the prefab that are the location of player's hand. I then sync their position and they have a script attached that locate them at the location of the hands depending of what gun is active. It works perfectly!
  • jeanfabre
    Options
    Hi,

    good, I am glad you fixed it, the End effectors are indeed the hands and look at target.

    Bye,

    Jean
  • Sahar
    Options
    Dear Steeven,

    Could you please give me more steps on how to send an avatar prefab with 3 gameobjects. I am able to send each gameobject with separated prefab but I couldn't send all the gameobjects with one prefab. Thanks you...