I want to be able to make the fingers bend based on how much the VR controller grip is pressed down.
For example:
I want to be able to make the fingers bend based on how much the VR controller grip is pressed down.
For example:
I believe VR controllers are treated like any other controller, so you should be able to detect how far down your grip is pressed like how you would on a controller.
Here’s a drawing showing what’s mapped to what for a vive controller.
Here’s a thread discussing how to get the “depth” a trigger was pressed down with.
I am able to detect how far down the grip is, but how would I go about bending the fingers based on the value I get? Would I need to make an animation?
I imagine it’d be a fully rigged hand and the grip amount would represent a frame in the animation. So you could use the grip strength to get a particular frame in the animation if that makes sense?
So what you could do is, if you know the animation length ahead of time, you could use math.clamp(gripStrength, startFrameValue, endFrameValue) to get a relative keyframe timestamp to set the hand to?.
Hope that makes sense.
Okay, let me test it out. Thank you.
You could also use animation weights with static looping poses to achieve a similar effect I imagine. Just keep in mind if you set the weight of an animation to 0 it breaks it, you wanna set it to like 0.001 instead
So how do I set the animation to a specific time then? I’ve searched around, but I’m not sure how to.
I believe animations can have keyframes, but you need to define them. A better way I think is to set the TimePosition of the AnimationTrack if you can, based on that grip strength value. It’d be the same way with math.clamp, you’d clamp that grip strength value based on the animation track’s length, like so:
local animationTrack = <animation track here, however you retrieve it>
local timePositionToSetAnimationTrackTo = math.clamp(<grip strength value here>, 0, animationTrack.Length)
animationTrack.TimePosition = timePositionToSetAnimationTrackTo
Something along those lines. You’d have to make it so the animation doesn’t have an animation speed at all, otherwise it would play the animation past that point.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.