- Home /
VR Rigidbody not working with child colliders
Hello, good day!
So Im working with an HTC Vive, in my scene i got a bunch of objects, some are complex as they have been imported from fbx files. An example is this one:
Which C39_Monitor is the main parent, it has a rigidbody with gravity enabled. The monitor-1 and postolje-1 are empty gameobjects, and finally Body_1_2 and Body_1 are the rendered objects. They have mesh colliders in convex mode and no rigidbodies. They work fine as they collide with other objects, but if I want to grab them I cant, the code is the same used in here.
Especifically, the problem is that this function:
private void SetCollidingObject(Collider col) {
if (collidingObject || !col.GetComponent<Rigidbody>()){
return;
}
collidingObject = col.gameObject;
}
Is searching for a rigidbody, but if I put a rigidbody (in gravity, or kinematic or both or neither) in the children, they either split, or fall through the floor down the scene, depending on the combination.
How can I make this work? I want to be able to grab the monitor, despite the different colliders in the whole gameobject and it to be as a whole, not by parts.
Hope this is clear, thank you in advance!
Your answer
Follow this Question
Related Questions
Does onTriggerEnter work with child colliders? 0 Answers
Colliders have weight, it's logical, but it destroys my concept. 0 Answers
Connect a collider with a rigidbody ?? 1 Answer
Stop child colliders from applying force individually 0 Answers
How to Access Components in Children of GameObject? 1 Answer