Play Testing!
<Play Test Video>
After several play testing, we found out something interesting. Many people tried to punch to the side because they feel that the ninjas are passing by. The game didn’t work really well because of that. So, we changed the punch mechanic.
The First apporach was based on Velocity Statemachine. When there is a spike on velocity, we checked the Wrist position and the distance from the shoulder, based on the thresholds the punches are confirmed.
The problem with this apraoch is was players other movements caused spike in the velocity and false punches declared.Added to that there were lot of false possitves when we measure the distance and the axis.
The second apprach was Colliders. We had plane colliders before players and we were checking the collision of wrist and velocity to declare the punches.We enhanced this by using a curved half capsule to cover all the angled punches.
The issue with this approach is when there is a rapid collision – that is when the users does a fast punch, the collision was nt detected becuase of the rate in which kinect gives Skeletal data and unity update/Fixed update cycle rate wasnt in sync.
Third approach is Raycasting on a collider. Since collision approach failed we used raycasting,Wrist distance from shoulders and velocity as parameters to declare punches.This approach helped to increase the detection accuracy far better.

