Search Unity

Adding a collider to a child object stops it rotating with its parent.

Discussion in 'Physics' started by polypixeluk, Sep 4, 2020.

  1. polypixeluk

    polypixeluk

    Joined:
    Jul 18, 2020
    Posts:
    53
    I'm moving a car around the outside of a cylinder with a sort of "car on a stick solution". But when I add a collider to the car it stops moving and I can't work out why.

    Here's my set up:

    A hub object is positioned at the world origin with a rigidbody and a script that adds torque.
    The car is a child of the hub and has a Y offset equal to the radius of the cylinder.

    That works.

    But now I want to have the car collide with triggers that I'm setting up around the outside of the cylinder and if I add a box collider to my car it no longer rotates around the cylinder. If I set the car's collider to be a trigger it moves again but I want the other objects to be the triggers not the car. The car collider doesn't have gravity applied and its positioned above the cylinder so there should be no collision friction. Can anyone explain to me what the problem is here?