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

Question Duplication of rigidbodies with different positions but same forces

Discussion in '2D' started by MadMath123, Jan 22, 2023.

  1. MadMath123

    MadMath123

    Joined:
    Jul 25, 2022
    Posts:
    3
    Hello all,

    Is there any way where I can have two rigidbodies be in different positions but have the same forces be acted upon them? As in: if one gets pushed to the left, the other one does, too. I'm very new to Unity, so sorry if this post isn't very clear.
     

    Attached Files:

  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    1,905
    Not that I know of. You apply forces to each Rigidbody, and it calculates accelerations for all of them at a moment outside your control. By the time you get one Rigidbody's accelerations and try to figure out the equivalent forces to apply to the other, you're a whole simulation step behind.

    There are probably some good ways to fake it, though, if you use kinematic models and simulate the physics yourself.
     
    Kurt-Dekker likes this.
  3. MadMath123

    MadMath123

    Joined:
    Jul 25, 2022
    Posts:
    3
    That seems like a good idea, but what happens if an object hits a wall or something? Is there an easy way to immediately stop all other objects, too?
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,623
  5. MadMath123

    MadMath123

    Joined:
    Jul 25, 2022
    Posts:
    3
    I want forces to not necessarily go on the same direction. For example, if one object fell over and the other was pushed to the left, the object would get a boost up .