Forum Discussion
vallenkilling
1 year agoHonored Guest
How To Get Contoller Veclocity (Meta SDK All-In-One)
I'm trying to get the velocity of how to get either of the VR Controllers so that it can be applied to another object when hit. I cant figure out how to aquire the velocty with the SDK setup. Any hel...
hvox1138
1 year agoProtege
Hi vallenkilling,
I don't think there's a centralized place from which that value is provided, but there are tools available that will help you calculate it. For a simple calculation, you can just monitor displacement over time directly --- for example, `(controllerPositionNow - controllerPositionATenthOfASecondAgo) / 0.1 seconds`.
If you want something more sophisticated, take a look at RANSACVelocity.cs (in the essentials package > Runtime > Scripts > Throw). This is how ISDK itself calculates velocities for throwing --- you can see this usage in Grabbable.cs --- but it should be usable for calculating good, noise-resilient velocity estimates of other things too, including controllers. I don't think there's much documentation about that file yet, but if you're interested and have questions, either I or LucaMefisto should be able to help you dig deeper.
Hope this helps, and best of luck!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device