Best way to get the degree difference between two vectors

I have a system where I save the velocity on a previous tick to a variable and then later compare that vector to the current velocity. I specifically want to know if the direction of the current velocity has changed more than 90 degrees from the previous one. What is the best way to do that? I know about Get Unit Direction, but that just returns the difference between the vectors (assuming I’m understanding it correctly). Or would there be a way I can use Get Unit Direction to do this?

These are components of the VR hand, and this check only happens when the velocities are above a certain threshold, so I don’t think they’ll ever be 0 when this is run.

then you could use two velocity’s directions to get dot product.the dot product,returns a positive number if the two direction is larger then 90 degrees,returns a negagive number if it’s less then 90 degrees.check if it’s greater then 0 :smiley: .

Thanks! I’m just trying to figure out of the player’s hand has changed direction too much during a specific action, so that probably won’t have any problems. I give that a try.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.