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

Object isn't moving but Transform.position is falling

Discussion in 'Physics' started by danield, Jul 13, 2018.

  1. danield

    danield

    Joined:
    Sep 30, 2014
    Posts:
    30
    Hello, I'm working with NavMeshAgent characters that also have a Physics component. A raycast is cast from the transform.positon for an empty child of the enemy to the player.
    Since it seemed like there should be no possible way the raycast could see around the obstacle, I added some debug code and got this result.
    FallingNotMoving.jpg Its transform.position.y starts close to 1.25 like I would expect, but drops slowly eventually below the ground. Why is the (empty or enemy) and player transform.position slowly falling but the inspector showing no change, and what are the fixes?
     
  2. danield

    danield

    Joined:
    Sep 30, 2014
    Posts:
    30
    The transform.position of the parent object is also falling. I disabled all the scripts that move the enemy just in case that had something to do with it.
    Still happened.
    Disabled gravity - Didn't happen but no gravity wouldn't look right
    Disabled NavMeshAgent - Didn't happen but this going to be a click to move game
    So the combination of physics + navmeshagent is the culprit.

    This is the first time I have worked with NavMeshes. Any veterans have tips for avoiding this?