Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Rigidbody.MovePosition alternative

Discussion in 'DOTS Physics' started by kexar66, Oct 28, 2020.

  1. kexar66

    kexar66

    Joined:
    Feb 27, 2013
    Posts:
    40
    Hello, is there any Rigidbody.MovePosition and Rigidbody.MoveRotation alternative for PhysicsBody?

    Thanks
     
  2. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,524
    The equivalent is moving the body with its velocity or AngularVelocity. There is a helper function in PhysicsVelocity for this: PhysicsVelocity.CalculateVelocityToTarget
     
    Baggers_, steveeHavok and kexar66 like this.
  3. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    377
  4. toomasio

    toomasio

    Joined:
    Nov 19, 2013
    Posts:
    132
    Is there a simple way to do this so it moves similar to Translation.Value += Velocity?

    I would like to move the position of a rigidbody, while at the same time, the rigidbody reacts normally to gravity and the built in systems. I know there is PhysicsVelocity.Linear += Velocity, but this creates a sliding movement vs snappy controls.
     
unityunity