Search Unity

Rigidbody.MovePosition alternative

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

  1. kexar66

    kexar66

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

    Thanks
     
  2. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    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:
    481
  4. toomasio

    toomasio

    Joined:
    Nov 19, 2013
    Posts:
    199
    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.