Search Unity

  1. Unity 2018.3 is now released.
    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. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    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:
    28
    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.