Search Unity

  1. Full schedule for #UniteBerlin is now available! Featuring talks on our roadmap, hands-on labs and much more! Check it out!
    Dismiss Notice
  2. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  3. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Rigidbody.MovePosition not working after update to 2017.3.0f3

Discussion in 'Physics' started by QutePolaBewr, Jan 20, 2018.

  1. QutePolaBewr

    QutePolaBewr

    Joined:
    Jun 21, 2015
    Posts:
    4
    After updating from 5.6.1f1, my RB wouldn't move and I couldn't figure out why. I still haven't been able to locate the problem. I am using the following code to move my RB :
    Code (CSharp):
    1. playerRB.MovePosition(playerRB.position + lookForward);
    I've tried to look up this problem for about an hour with no luck or mention of why my RB would move in 5.6.1f1, but not in the updated version of unity. If you have any solutions to this problem please let me know. Thank you.
     
  2. yann-papouin

    yann-papouin

    Joined:
    Mar 21, 2014
    Posts:
    5
    Yep, same issue with 2017.3.1p2
    Tried in Update() and FixedUpdate()
    Note that MoveRotation is also no more working anymore.
     
  3. yann-papouin

    yann-papouin

    Joined:
    Mar 21, 2014
    Posts:
    5
  4. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    5,697
    How is that the issue, though? MovePosition will respect interpolation, but if it isKinematic then it does not. I don't see how this would cause zero-movement behavior.
     
  5. Steamc0re

    Steamc0re

    Joined:
    Nov 24, 2014
    Posts:
    98
    Same problem here
     
  6. HaddicusGames

    HaddicusGames

    Joined:
    May 28, 2014
    Posts:
    25
    I ran into this issue, and then I realized I was moving along the z axis in 2d, instead of x.... hopefully this helps someone else. This is working fine for me in 2017.4.
     
  7. Steamc0re

    Steamc0re

    Joined:
    Nov 24, 2014
    Posts:
    98
    I can create a new rigidbody and move it using movePosition(), but all my rigidbodies controlled by scripts still don't work in 2017.4.2f2 that were created in older versions.
     
  8. MenteBacata

    MenteBacata

    Joined:
    Dec 20, 2016
    Posts:
    4
    It looks like MovePosition doesn't like when transform is modified on the same FixedUpdate.
    I've made this script, attached to a capsule with a non kinematic rigidbody (I'm on Unity 2017.3.0f3).
    Code (CSharp):
    1.  
    2.     public class TestMovePosition : MonoBehaviour
    3.     {
    4.         void FixedUpdate()
    5.         {
    6.             transform.rotation = Random.rotation;
    7.             GetComponent<Rigidbody>().MovePosition(new Vector3(0f, 1.5f, 10f));
    8.         }
    9.     }
    10.  
    Object doesn't change its position.
    Also it seems that transform needs to change in order to void MovePosition. That is, if transform.rotation is set to a costant value which is different from the original, than MovePosition is only skipped on the first time.
     
  9. canis

    canis

    Joined:
    Oct 25, 2013
    Posts:
    23
    same issue, on 2018.1.0f2