How can I grab an object in VR?

Specifically, I’d like to pick up a gun or a knife. I already have the hand model and its animations, and I want to start experimenting with this type of behavior. How could I go about achieving this? For instance, I want the user to be able to use the controller to grab a virtual gun or knife with the hand model and perform actions. I’ve been looking at the drag controls script, but I’m not sure if it can be useful for what I want. Any advice on how to start or how can i approach this?

Original Post on Discord

by user 691445074055397447

Hey :wave:

The WebXR component in VR spawns 2 controllers which you can reference and mount objects to them.
You can parent your object under them and that way you are able to make something appear in your hand.

Here’s an unreleased component which you can use and edit.

Alternative solution is to use an Avatar:


And place your object in there

It depends on what you are making.

Let me know how it goes or if you have further questions :slight_smile: :cactus:

Ok ok perfect. I’ll give it a try. Thank you very much

by user 691445074055397447