Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Cant put object inside another object

Discussion in 'Editor & General Support' started by Select_Casey, Dec 8, 2014.

  1. Select_Casey

    Select_Casey

    Joined:
    Nov 12, 2014
    Posts:
    26
    Hello again. im having difficulty again and i need some advice from someone more experienced in these matters.

    i want to make a sort of monkeyball game based on the roll-a-ball demo. i have two objects with colliders and rigidbodies, the character and the ball. unfortunately, if i place the character inside the ball, when the game starts hes forced out of it.

    What am i doing wrong plz?
     
  2. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
  3. Select_Casey

    Select_Casey

    Joined:
    Nov 12, 2014
    Posts:
    26
    that was the point his physics need to interact with the ball, just not like this. the idea is that the player inside the ball moves and his movement effects the ball.which transports the player around.

    so what am i doing wrong?
     
  4. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Please read the documentation... go through the Learn resources and the answer will smack you in the face. It's because the colliders are trying to collide at their extents (outside to outside). If you want it to work the way you're trying to do it you'll have to do something different like use a mesh collider from a low poly mesh so you can interact with the Inside of the collider.
     
  5. Select_Casey

    Select_Casey

    Joined:
    Nov 12, 2014
    Posts:
    26
    thank you. that was far more helpful.
     
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Primitive colliders are considered solids, and not hollow. Also, in 3D, raycasts do not collide if inside the primitive. The exception is using an inverted mesh collider, however I do not know if this would work well in Unity 5. In cases like this, there is usually always custom code.
     
    Dustin-Horne likes this.
  7. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Thanks for expounding Hippo. I was only about 90% certain I was answering correctly because there are always neat things in Unity that I have yet to learn about.
     
  8. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194