I want to add an impact for a punch. Does anyone know how to figure out which direction and how fast the hand is moving?
Thanks
I want to add an impact for a punch. Does anyone know how to figure out which direction and how fast the hand is moving?
Thanks
Get the world position of the motion controller and put it into a variable called “oldPosition” each tick. At the start of each tick, get the controller position, and subtract oldPosition, that resulting vector is your direction, and the length is the velocity for this tick. Then store the current position to oldPosition so it’ll get used in the next tick again.
It will look something like that
The Motion Controller Component has “Get Linear Velocity” and “Get Angular Velocity” functions that receive the velocity values straight from the tracking system of whatever VR hardware you’re using, converted to Unreal units.