#detect if player is doing a hand movement
1 messages · Page 1 of 1 (latest)
You could use player body position and player body orientation as a reference point
I would use the distance between the players hand and head, and/or the players body
Well don’t say “how do i detect for a position”
WHAT Specific hand movement?
There’s sorta like billions of combinations
Hand Rotation -> Quaternion Inverse -> Rotate Vector [Rotation]
Hand Velocity -> Rotate Vector [Point]
Body Orientation -> Rotate Vector [Rotation]
Rotate Vector [Result|Vector3] -> Rotate Vector [Point]
This will rotate the Hand Velocity relative to the body.
@scenic leaf
By rotating the velocity of your hand by the inverse of somethings rotation, you will have velocity relative to that thing
By rotating by the inverse of your hand rotation, you have hand velocity relative to your hand
Yup! And now you can use Vector Dot with this and a Vector3 Create in the direction you want (in this case [1,0,0] for Right Motion) @scenic leaf
These numbers are the Velocity of the hand dependent on which direction you swing.
If you swing to your body's right, the numbers will be a positive number of your velocity's magnitude. If you swing left, the numbers will be a negative number of your velocity's magnitude.
If you want a number from -1 (left swing) to 1 (right swing), you can use Vector3 Normalize on your Hand Velocity (or on the result of the Rotate Vector.)
This would, however, mean that if you move your hand to the slightest right, it would output close to 1, and cause accidental triggers, so I would recommend not normalizing the velocity.
Use a Greater or Equal chip on the Vector3 Dot and check if the result is Greater or Equal to whatever velocity you want to trigger it.
You can use this to detect if your hand is swinging left or right relative to where your body is facing.
@scenic leaf
If you rotate hand velocity by the inverse of another things rotation, the velocity will be relative to that thing, thats literally the definition of "not dependent on rotation"
I would highly advise using Get Rotation of the local player, not body rotation