Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. 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
  8. 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,918
    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:
    106
    Same problem here
     
  6. HaddicusGames

    HaddicusGames

    Joined:
    May 28, 2014
    Posts:
    27
    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:
    106
    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:
    9
    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:
    33
    same issue, on 2018.1.0f2
     
  10. Steamc0re

    Steamc0re

    Joined:
    Nov 24, 2014
    Posts:
    106
    @mentebaca I found the same. I changed it to rb.moverotation instead of transform.rotation and it works now.
     
  11. Psyboyo

    Psyboyo

    Joined:
    May 16, 2017
    Posts:
    2
    Same here on 2018.1.0f2.
    If anyone finds a fix, or Unity team fixes it, please post here. We will keep returning here, to check if anything changed.
     
  12. Steamc0re

    Steamc0re

    Joined:
    Nov 24, 2014
    Posts:
    106
    I think this is the expected behavior that they've only gotten around to locking down now. We've always read to use Rigidbody in FixedUpdate and Transform in Update; it always still worked up until now. Maybe they're just forcing this.