Interactive Kinect Game

I dont really know how the Microsoft Kinect works but i want to make a pretty nice game and i want it to where the player can choose to play interactive and this mode requires a webcam but is it even possible to use a webcam to track hand movements?

Microsoft just opened the Kinect sdk beta recently, it is free for learning (non commercial licences available yet) I played around with it a bit in c# and it does simplify image capturing, and I imagine it would be easy to access the sdk classes with a pro licence.

http://kinectforwindows.org/

It will, of course, only work with windows. Note: You will need a Kinect to program with it, and your end user would need one as well.

Image tracking is a too heavy job to be executed at the script level. You should develop or obtain a tracking image software in DLL form, and integrate it to Unity as a plugin (Pro required).

Meanwhile, you can play around with a very interesting (and free!) software, Camera Mouse. This software controls the mouse pointer using webcam image tracking. As is, it can be used to click GUI buttons - just go to its Settings window and turn camera mouse clicks on: it generates a click whenever the mouse pointer stays in the same region for more than a minimum time; both (the region size and the minimum time) are selectable in the Settings window.

Unfortunately, it doesn’t control the “Mouse X” or “Mouse Y” axes directly - but affects mousePosition, thus can be used to aim or move things with some script help. The routines below, for instance, are intended to simulate Input.GetAxis(“Horizontal”) and Input.GetAxis(“Vertical”) with head movements - attach to a CharacterController and try it:

// Returns -1 to +1 with head horizontal movement:
function GetAxisHorizontal(): float { 
  return (2 * Input.mousePosition.x / Screen.width) - 1;
}

// Returns -1 to +1 with head vertical movement:
function GetAxisVertical(): float {
  return (2 * Input.mousePosition.y / Screen.height) - 1;
}

// CharacterController script adapted to use cameraMouse:

var speed : float = 6.0;
var jumpSpeed : float = 8.0;
var turnSpeed : float = 60;
var gravity : float = 20.0;

private var moveDirection : Vector3 = Vector3.zero;
private var controller : CharacterController;

function Update() {
    if (!controller) controller = GetComponent(CharacterController);
    var turn: float = GetAxisHorizontal();
    if (Mathf.Abs(turn)>0.3){
        transform.Rotate(0, turn * turnSpeed * Time.deltaTime, 0);
    }
    if (controller.isGrounded) {
        var fwd = GetAxisVertical();
        if (Mathf.Abs(fwd) > 0.5){
            moveDirection = -fwd * transform.forward * speed;
        } else {
            moveDirection = Vector3.zero;
        }			
        if (Input.GetButton ("Jump")) {
            moveDirection.y = jumpSpeed;
        }
    }
    // Apply gravity
    moveDirection.y -= gravity * Time.deltaTime;
    // Move the controller
    controller.Move(moveDirection * Time.deltaTime);
}