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. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. 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
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    22
    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:
    22
    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?