Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

CharacterController.Move makes transform position (NaN, NaN, NaN) on win platform

Discussion in 'Physics' started by smiletech_dev, Oct 2, 2018.

  1. smiletech_dev

    smiletech_dev

    Joined:
    Sep 3, 2018
    Posts:
    4
    I use CharacterController.Move in FixedUpdate of a model, the motion vector is calculated with some spec rules. The motion vector itself is not NaN, and before Move the position is right. But after Move it becomes NaN.

    My script is some like :
    Code (CSharp):
    1. motion = calc_motion();
    2. pos1 = playercc.transform.position;
    3. playercc.Move(motion);
    4. pos2 = playercc.transform.position;
    And I catch some logs like :
    model move invalid : (0.1, 0.0, -0.1) (NaN, NaN, NaN) (9.4, 0.0, -0.2) (NaN, NaN, NaN)

    1st vec is motion, 2nd is current position, 3rd is pos1, 4th is pos2.

    Unity version is 2017.4.3. Seems like this only happens on Windows, not on iOS nor on Android.
     
  2. smiletech_dev

    smiletech_dev

    Joined:
    Sep 3, 2018
    Posts:
    4
    Still exists in version 2017.4.12f1
     
  3. smiletech_dev

    smiletech_dev

    Joined:
    Sep 3, 2018
    Posts:
    4
    So nobody ever had this problem? Clearly it's a bug.
     
  4. krisu

    krisu

    Joined:
    Jul 10, 2013
    Posts:
    31
    weird... i have 2018.2.10 and i use also CC with move(). and i dont see any NaN values.
     
  5. smiletech_dev

    smiletech_dev

    Joined:
    Sep 3, 2018
    Posts:
    4
    It happens in some conditions, maybe get stuck with some colliders? But I can not find the rule, and in my logs i haven't find any "strange" positions cause this.