#player relative velocity mesurements
1 messages · Page 1 of 1 (latest)
Quaternions! I always forgot the exact way to do it until i'm in-game playing with it though, hopefully someone else can elaborate on it
ill mess around with them later to see if i can get something to work until someone can elaborate more, if j get it to work by then at least this post will help someone else with the same issue
i tried to rotate vector using the player head orientation, it worked somewhat but depending on which way im facing it caused left hand swip and right hand swip movements to change
basically, face forward in room, hand moves right does task A, hand moves left does task B, if i rotate myself 90 degrees task A and B swap around
so left swipe does A and right swipe does B
Oh if you just need it to be detecting left and right, i know what to do.
You can use vector cross on the up and forward vectors of someone's head, it outputs a vector perpendicular to the inputs (imagine you're using the up and forward vectors to mark where there is a flat plane, and the output is a vector sticking perfectly out of that plane)
Use vector dot to compare the hand velocity (normalised) against this vector, with close to 1 meaning it's right, and close to -1 meaning it's left (or the other way around, i forget what order you have to cross the up and forward vector to get what direction)
awesome thank you
get the velocity and rotate it (using the rotate vector chip) by the inverse rotation of the player.
(Rotate Vector(Vector = Player Right Hand Velocity, Rotation = Quaternion Inverse(Get Rotation(Player))))
thank you so much!
yep works
Good to hear! You can mark this post as answered by selecting the "three dots icon" (···), selecting "Edit Tags", and enabling the "
Answered" checkbox.
got it