Search Unity

Box Collider does't drag RigidBody

Discussion in 'Getting Started' started by gabz0r, Feb 5, 2015.

  1. gabz0r

    gabz0r

    Joined:
    Oct 29, 2013
    Posts:
    3
    Hey there,

    I have a player gameobject with RigidBody2D and CircleCollider2D attached to it, the gameobject falls down onto the floor, which is another gameobject with just a BoxCollider attached. The floor is moved like so:

    Code (csharp):
    1.  
    2. void Update () {
    3.     transform.position += new Vector3 (-2 * Time.deltaTime, 0);
    4. }
    5.  
    The problem is the player gameobject, that isn't affected by the floor moving beneath it. I want the player to be dragged with the moving floor. Both gameobject have Materials attached to them with Friction set to 1.

    Thanks for your Help
    gabs
     
  2. gabz0r

    gabz0r

    Joined:
    Oct 29, 2013
    Posts:
    3
    I guess this is a real beginner problem, so isn't there anyone that can help me?
     
  3. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    834
    gabz0r likes this.
  4. gabz0r

    gabz0r

    Joined:
    Oct 29, 2013
    Posts:
    3
    Thanks alot, that solved the problem!