r/oculusdev • u/CobaltEdo • Dec 13 '23
Unable to grab imported 3D models - Unity/C#
I am working on an Oculus project with Unity and I bumped in the following problem: My project requires me to import some 3D models, TriLib is being used for this), with whom I want to interact both via ray interactions and grab interactions (not at the same time).
I create a prefab object that already contains the grabbable component, the rigidbody required, the grab interactable and the collider. When I import the object placing it inside the prefab, I take its mesh, create a meshcollider and assign it to the collider for the interactions, but when I try to grab the object in the scene nothing happens. While they ray interactions do work.
I've already tried to manually download the model, place it in the assets and load it in the scene through using Resource.Load and the grab interactions work fine in this case, even if the hierarchy and the inspector components/properties look the same.
Anyone has any idea on what else could I be doing wrong?
EDIT: I tried to make a "copy" of the imported 3D model by creating a new GameObject and copying the MeshFilter, MeshRenderer and Mesh Collider of the original resulted from TriLib. Now the controllers' grab interactions seem to work, but not the hands' one.
1
u/rocknrollstalin Dec 14 '23
Have you considered how this object interacts with any layer mask for Grabbable? Check the layer property and maybe you have to manually set it on your created GameObject
1
u/OMPR_App Dec 13 '23
Have you ensured that the grabbable object's Rigidbody component of yours has the following settings?
"Use Gravity" is set to true and "Is Kinematic" is set to false
1
u/Agent_A- Feb 18 '24
ayo facing the same problem , if you find anything plz post