@@ -245,7 +245,8 @@ static public void LoadModel(int index)
245245 root = GameObject . Find ( playermodel_torso ) ;
246246
247247 headbone = GameObject . Find ( playermodel_head ) ;
248- headtarget = GameObject . Find ( "Global/Local VRRig/Local Gorilla Player/rig/body/head" ) ;
248+ headtarget = GorillaTagger . Instance . offlineVRRig . mainSkin . transform . parent . Find ( "rig/body/head" ) . gameObject ;
249+
249250
250251 PlayerModelAppearance . playermats = GameObject . Find ( "playermodel.body" ) . GetComponent < SkinnedMeshRenderer > ( ) . materials ;
251252
@@ -299,7 +300,7 @@ static public void LoadModel(int index)
299300 public static int modelVersion ;
300301 static public void AssignModel ( )
301302 {
302- // Debug.Log("playermodel assigned");
303+ Debug . Log ( "playermodel assigned" ) ;
303304 if ( player_info . Length > 4 )
304305 {
305306 modelVersion = 1 ;
@@ -308,10 +309,15 @@ static public void AssignModel()
308309 {
309310 modelVersion = 0 ;
310311 }
311- Debug . Log ( modelVersion ) ;
312- GameObject hand_l = GameObject . Find ( "Global/Local VRRig/Local Gorilla Player/rig/body/shoulder.L/upper_arm.L/forearm.L/hand.L" ) ;
313- GameObject hand_r = GameObject . Find ( "Global/Local VRRig/Local Gorilla Player/rig/body/shoulder.R/upper_arm.R/forearm.R/hand.R" ) ;
314-
312+ Debug . Log ( "Model Version: " + modelVersion ) ;
313+
314+ GameObject hand_l = GorillaTagger . Instance . offlineVRRig . mainSkin . transform . parent . Find ( "rig/body/shoulder.L/upper_arm.L/forearm.L/hand.L" ) . gameObject ;
315+ Debug . Log ( hand_l ) ;
316+ GameObject hand_r = GorillaTagger . Instance . offlineVRRig . mainSkin . transform . parent . Find ( "rig/body/shoulder.R/upper_arm.R/forearm.R/hand.R" ) . gameObject ;
317+ Debug . Log ( hand_r ) ;
318+ GameObject bodyrig = GorillaTagger . Instance . offlineVRRig . mainSkin . transform . parent . Find ( "rig/body" ) . gameObject ;
319+ Debug . Log ( bodyrig ) ;
320+ //Debug.Log("CHECK1");
315321 offsetL . transform . SetParent ( hand_l . transform , false ) ;
316322
317323 offsetR . transform . SetParent ( hand_r . transform , false ) ;
@@ -370,7 +376,7 @@ static public void AssignModel()
370376 HandRight . AddComponent < FastIKFabric > ( ) ;
371377 HandRight . GetComponent < FastIKFabric > ( ) . Target = offsetR . transform ;
372378 HandRight . GetComponent < FastIKFabric > ( ) . Pole = poleR . transform ;
373- root . transform . SetParent ( GameObject . Find ( "Global/Local VRRig/Local Gorilla Player/rig/body" ) . transform , false ) ;
379+ root . transform . SetParent ( bodyrig . transform , false ) ;
374380 root . transform . localRotation = Quaternion . Euler ( 0f , 0.0f , 0.0f ) ;
375381
376382 headbone . transform . localRotation = headtarget . transform . localRotation ;
0 commit comments