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

Movement without loss of energy

Discussion in 'Physics' started by DxStd_IgnatPribylov, Sep 24, 2015.

  1. DxStd_IgnatPribylov

    DxStd_IgnatPribylov

    Joined:
    Sep 24, 2015
    Posts:
    30
    Hi everyone!
    How to make body (Rigidbody) not lose their energy in collisions with other body? (2D physics)
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hi,

    some hacks that I'd try if possible in your case;

    1. make it kinematic, then move it by rigidBody2D.MovePosition,

    2. Or by modifying transform.position (this is not recommended I guess?)

    3. Or make it have large mass, and make other objects have very small mass compared to it.
     
  3. DxStd_IgnatPribylov

    DxStd_IgnatPribylov

    Joined:
    Sep 24, 2015
    Posts:
    30
    Unfortunately - no. Small object "A" faces a large "M, D, C" (all have a component rigidbody). And the object "А" should not lose energy.
     
  4. erandros

    erandros

    Joined:
    Sep 23, 2015
    Posts:
    6
    In 3d, the material Zero friction is available. Is this available too in 2d?
     
  5. DxStd_IgnatPribylov

    DxStd_IgnatPribylov

    Joined:
    Sep 24, 2015
    Posts:
    30
  6. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    DxStd_IgnatPribylov: Probably depends on what you are doing, my point was that by moving object that is kinematic, you can move it either by physics system or transform and it still collides with other physics object, but their weight / collision won't slow down moving/colliding object.

    But I've got no idea what you are doing, so I was only making my best guess.

    And if there is no loss of movement speed, the result is same as moving object using constant velocity or something similar.