Question by
HMM96 · Mar 19, 2017 at 01:12 PM ·
gameobjectdistancevectorchild object
how to use vectors to control an outcome
I need to find a game object and look through the object for the children finding their position subtracting vector A from vector B to find the points between each.
If vector A is above vector B then do this...
The points the vectors are attached to will constantly be moving as object is controlled using gestures
Comment
The code below is what I have written to find the children of the game object.
I would need to usethe vectors to figure out the position of the children. To extend my example I would need: if the left hand is above left elbow then it should do this..
public class kinectman : $$anonymous$$onoBehaviour{ public GameObject man;
GameObject lefthand;
GameObject leftelbow;
GameObject righthand;
GameObject rightelbow;
void breakdown() {
lefthand = GameObject.Find("13_Hand_Left");
leftelbow = GameObject.Find("11_Elbow_Left");
righthand = GameObject.Find("23_Hand_Right");
rightelbow = GameObject.Find ("21_Elbow_Right");
}
}