Search Unity

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:
    40
    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.