The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Sync IK

Smiderplaner
2018-02-06 01:32:16

Hello im trying to sync my IK i have attached this script to the player and active it when spawned but it dosent sync rotation so it dosent look up and down, i have tried everything even put a photon view on the look position transform but it dident work either, so can somebody be nice take a look at my script ? please help me with my first online game.

using System.Collections; using System.Collections.Generic; using UnityEngine;

public class IKHandling : Photon.MonoBehaviour
{
Animator anim;

}

## Comments

Smiderplaner
2018-02-06 01:36:33

I have tried for days now to get it work, can somebody give me any hint how to sync position and rotation so everyone can see it? can post more script if necessery

Smiderplaner
2018-02-07 00:32:05

If i have animate physics on and put 1 of the 3 Spines in the model on my photon view on the parent its working but jiddering/teleporting back to orginial position and not syncing full rotation so now im confused becouse its only working with syncing that, shouldent it work with sync the whole model? can somebody point out this problem i can send screenshots if needed.

jonavuka
2018-02-27 01:51:31

It's not syncing because from what i see from your script your not telling it what to sync... You instantiate a transform but only to the local player, the remote player is unaware of that object. Once you get the remote to also instantiate the transform then you need to update the remote player the transform's position, however I wouldn't bother with a transform and just have a world position as a Vector3 that way you don't need to instantiate anything and all you need to do is update the remote player the Vector3 look at position

CarterManley
2018-08-03 18:56:28

Ive tried to sync the look at position and was unable to get any response. I also serialized all the ik weights, added photonviews and transform views to the look at transform which is an empty gameobject attached to my camera and the camera rig is attached to my player as a child object. The only gamobject Im photon.instantiating is my player. Heres my script below

CarterManley
2018-08-03 18:57:36

public class AnimatorHook : Photon.PunBehaviour
{

CarterManley
2018-08-03 18:58:00

public float count = 5;
public float tickcount;

CarterManley
2018-08-03 18:58:35

void FpsIkPos()
{
if (!states.states.isAiming && states.states.isAiming1)
{
rh_target.localPosition = states.wSystems.wepSystemReferences.wepHook.FPSS.FPSRegularIk.pos;
rh_target.localEulerAngles = states.wSystems.wepSystemReferences.wepHook.FPSS.FPSRegularIk.rot;
basePosition = states.wSystems.wepSystemReferences.wepHook.FPSS.FPSRegularIk.pos;
baseRotation = states.wSystems.wepSystemReferences.wepHook.FPSS.FPSRegularIk.rot;
}
if (states.states.isAiming1 && !states.states.isAiming)
{
rh_target.localPosition = states.wSystems.wepSystemReferences.wepHook.FPSS.FPSNoAimFiringIk.pos;
rh_target.localEulerAngles = states.wSystems.wepSystemReferences.wepHook.FPSS.FPSNoAimFiringIk.rot;
basePosition = states.wSystems.wepSystemReferences.wepHook.FPSS.FPSNoAimFiringIk.pos;
baseRotation = states.wSystems.wepSystemReferences.wepHook.FPSS.FPSNoAimFiringIk.rot;
}
if (states.states.isAiming)
{
rh_target.localPosition = states.wSystems.wepSystemReferences.wepHook.FPSS.FPSAIMIK.pos;
rh_target.localEulerAngles = states.wSystems.wepSystemReferences.wepHook.FPSS.FPSAIMIK.rot;
basePosition = states.wSystems.wepSystemReferences.wepHook.FPSS.FPSAIMIK.pos;
baseRotation = states.wSystems.wepSystemReferences.wepHook.FPSS.FPSAIMIK.rot;
}
}

CarterManley
2018-08-03 18:58:57

[PunRPC]
void OnAnimatorIKRPC()
{
if (photonView.isMine == false)
{

}

CarterManley
2018-08-03 21:43:48

Can i give someone money to help?? this is insane!

CarterManley
2018-08-05 05:36:46

Values from onAnimatorIk to Update ik werent being passed through the network. I was able to solve it finally XD Thanks for the help!

kkost
2019-03-03 19:10:10

can you post your fixed code?

Back to top