Search Unity

Steam VR 2.0 - colliders beginners question

Discussion in 'Physics' started by CraigSimpson, Dec 20, 2018.

  1. CraigSimpson

    CraigSimpson

    Joined:
    Nov 30, 2018
    Posts:
    4
    Hi, I’ve had Unity for a couple of weeks and have a total beginners question.
    I have installed the Steam VR 2 plug in and I am running the Interactions Scene that comes with the download.
    I am trying to understand how objects pass through each other or not.
    In the scene we have two tables, one with cubes and spheres that you can pick up and they can be passed through other colliders. The other table has cubes and spheres that can not be passed through other colliders.
    In the two hierarchys the actual cube and sphere gameobjects have identical components and are no different to each other but if moved under the other parent gameobjects their behaviour then changes. A passing through cube moved under the parent of a non passing through cube had it’s behaviour changed.
    So, the difference must be in the parent object?
    However, I can not see any significant difference between the two parent objects that would change the collider behaviour.
    The small component differences there are I have changed just in case but I’ve had no joy.
    Can anyone explain in this scene why the two parent gameobjects generate the two different behaviours? In beginners speak!
    I want to move this behaviour to an industrial application for moving production parts into specific areas.
    Thanks in advance.
    Craig.
     
  2. knobblez

    knobblez

    Joined:
    Nov 26, 2017
    Posts:
    223
    So, at the end of the day parents are in charge of what goes on. If your child objects have colliders but the parent does not, the children will pass through other objects as-if they did not have a collider.

    Reason being this:

    If you have 2 people (people have skin and bones and stuff aka 'colliders'), and they walk into each other, they'll feel it and won't be able to pass each other. If a ghost and a person walk into each other there would be no contact, because there is nothing to collide with on the ghost.

    If you took a person and put them in a ghost(aka person is child of the ghost), they become a ghost, too.
     
    CraigSimpson likes this.
  3. CraigSimpson

    CraigSimpson

    Joined:
    Nov 30, 2018
    Posts:
    4
    Thanks for the reply - it makes sense.

    My hierarchy is as below.

    pass_hierarchy.jpg


    The cube that DOES NOT pass through any other item has this parent -
    Not_Passing_through_parent.jpg

    and this child -
    Not_Passing_through_child.jpg


    And the cube that CAN pass through has this parent -
    Passing_through_parent.jpg


    and this child -

    Passing_through_child.jpg


    These behave exactly the same in my project as they did in the Steam VR2 Interactables demo I took from the Asset store, which rules out something I have done by mistake.

    I hope these files can help anyone deuce what's going on.
    Thanks.
    Craig.