I always wonder how do I update my zigfu updater?
I cannot called it at my update function.
Please help me out for this.
void Start () {
KK = GameObject.Find ("Blockman").GetComponent<Kick> ();
ball = GameObject.Find ("Ball");
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter(Collider col){
if (col.gameObject.name == "LeftFoot") {
Debug.Log("Leftfoot");
//KK.OnLeftkicking();
ball.rigidbody.AddForce(leftFootVelocity);
}
if (col.gameObject.name == "RightFoot") {
//KK.OnRightkicking();
Debug.Log("Rightfoot");
ball.rigidbody.AddForce(rightFootVelocity);
}
}
public void Zig_UserUpdate(ZigTrackedUser user)
{
if (user.Id == trackingId) {
oldLeftFoot = currLeftFoot;
oldRightFoot = currRightFoot;
if (user.SkeletonTracked) {
currLeftFoot = user.Skeleton[(int)ZigJointId.LeftFoot].Position;
currRightFoot = user.Skeleton[(int)ZigJointId.RightFoot].Position;
//currLeftHand = user.Skeleton[(int)ZigJointId.LeftHand].Position;
/*ZigInputJoint torso = user.Skeleton[(int)ZigJointId.Torso];
Vector3 calculated = origin.position - torso.Position;
Debug.Log ("distance compared: " + calculated);*/
rightFootVelocity = (currRightFoot - oldRightFoot) * 100;
leftFootVelocity = (currLeftFoot - oldLeftFoot) * 100;
Debug.Log ("Right V: " + currRightFoot.ToString());
Debug.Log ("Left V: " + currLeftFoot.ToString());
Vector3 LF = currLeftFoot;
Vector3 RF = currRightFoot;
LF.z *= 10000;
RF.z *= 10000;
LF.x *= 1000;
LF.y *= 1000;
RF.y *= 1000;
RF.x *= 1000;
}
}
}