Search Unity

Question uhhh how do i explain this

Discussion in 'Physics' started by Sindaga, Aug 24, 2023.

  1. Sindaga

    Sindaga

    Joined:
    Feb 14, 2023
    Posts:
    15
    Well I was making this donut to move while falling down and when I finished well the donut started shaking up and only went to one side
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,466
    Whilst I'd love to help, nobody can debug a video but only play a guessing game of imagining what you might be doing. :)

    You need to explain with some detail on the set-up and how these presumably physics objects are being moved, what's supposed to happen etc.

    Thanks.
     
    Edy and bugfinders like this.
  3. Sindaga

    Sindaga

    Joined:
    Feb 14, 2023
    Posts:
    15
    Thank you for letting me know right here there's more information about the physics of the donut:
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,466
    The whole point of a Rigidbody2D is to solve physics and move then write to the Transform. You should never be writing to the Transform yourself. Physics are not passive components like renderers, they are active and drive the Transform.

    In this respect, use the provided Rigidbody2D API as all of the tutorials will show you i.e. adding forces, using MovePosition, setting velocity etc.

    Also, don't nest Dynamic bodies. If you want explicitly control of position then use Kinematic bodies and use MovePosition/Set velocity.
     
  5. Sindaga

    Sindaga

    Joined:
    Feb 14, 2023
    Posts:
    15
    Yeah it worked, but not exactly.
    Well when it reaches a point it freezes and do absolutely nothing
    it doesn't fall down
     
    Last edited: Aug 25, 2023
  6. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,466
    TBH You need to follow some tutorials; the forums are not here to teach you how to use physics and there's plenty of material online to teach you this stuff.

    Kinematics are there to give you explicit control of movement; they don't react to forces or gravity.