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

Object laying on a rotating object doesn't move

Discussion in 'Physics' started by Sheradil, Jun 23, 2015.

  1. Sheradil

    Sheradil

    Joined:
    Feb 19, 2014
    Posts:
    15
    Hey,

    I have a conveyor belt. More precisely:
    I have some "rolls" with rigidbodies next to each other that have a fixed position and they are rotating around the long axis with an attached script rotating them at 10 degrees a second.

    I have another object with a rigidbody that is laying on top of the rolls at the start of the game.

    From my point of view the Object on top of the rolls should automatically move as the rolls rotate. But for some reason it moves faaaaar toooo slooooow, if at all (Sometimes it even moves into the opposite/wrong direction).
    I'm wondering why the object behaves like this.

    I don't have any special materials attached to any of those mentioned objects (Though even the basic materials of unity that I attached for testing purposes didn't help at all).
    Could the reason for this behaviour be that the friction is missing ?
    Or is there any other possible reason ?

    My basic physical knowledge in my head still says that it should work already without any other modifications.

    Thanks for help in advance,
    Shera
     
  2. LeShadow

    LeShadow

    Joined:
    May 4, 2014
    Posts:
    12
    How exactly does that script work? Are you, perchance, setting the rotation directly? Or are you applying a force?
     
  3. Sheradil

    Sheradil

    Joined:
    Feb 19, 2014
    Posts:
    15
    Each roll has a script with an UpdateMethod containing:
    transform.Rotate(Angle);
    I don't apply a force myself. I just thought that by rotating it manually, the underlaying physics of unity would calculate movements based on the friction between the roll and the object on it.

    From the way you posted your answer I guess that I should apply a force myself ?
     
  4. LeShadow

    LeShadow

    Joined:
    May 4, 2014
    Posts:
    12
    Yes. In general, if you move or rotate an object directly, the physics engine won't react to that. You might trigger a collision (on the next physics tick) by moving things into other things, but you won't get any friction.

    Try applying a force and letting the physics engine handle the rotation. You might also have to fine tune your physics materials and settings before the behaviour "feels" right.
     
  5. Sheradil

    Sheradil

    Joined:
    Feb 19, 2014
    Posts:
    15
    Thank you,
    it works now. More or less at least ;)
    As you said, I guess we have to "fine tune" a bit.
    The packages are moving, but for some reason they are always shivering a bit and make slight turns to the left or the right.
    But I'm sure we will figure that out