- Home /
Zigfu Update status
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;
}
}
}
Comment
Answer by BarisCirika · Apr 07, 2014 at 12:44 PM
Are you want to learn how to handle events to run Zig_UserUpdate function?
if yes
Add empty gameobject than add zig c#. And then
Add your c# code to gameobject (empty gameobject or necessary gameobject).
Add that gameobject to zig (by default Zig Listeners is 0. Increase listener size, if 0 change it to 1 etc, than add your gameobject which has your c# code, to zig as listener member).
Your answer
