Search Unity

Falling from a cliff

Discussion in 'Navigation' started by Xwilarg, Nov 12, 2019.

  1. Xwilarg

    Xwilarg

    Joined:
    Jul 13, 2016
    Posts:
    21
    Hi,

    I have a Unity project where I want some AI to fall from a cliff, I managed to do it but when it happens they go through the floor.
    I think it's because the navigation area doesn't allow them to go too close to the edge.
    Is there a way to fix that?

    Thanks in advance
     
  2. DwinTeimlon

    DwinTeimlon

    Joined:
    Feb 25, 2016
    Posts:
    300
    Your question is a little unspecific tbh. How do they fall from the cliff? Should they jump, are they hit by a player/projectile and stagger? Because there are different solution to each of those problems. Also why do you cut the navigation area before the cliff?
     
  3. vhman

    vhman

    Joined:
    Aug 13, 2018
    Posts:
    359
    NamMesh always "cut" navigation area on amount equal to agent radius, otherwise you will be able to put half of an agent body into the wall, or stand in air in this case.

    I assume that @Xwilarg does not have falling animation that is triggered on "jump", so he have this jaggy flor clipping.

    The setup is ok, you can see exactly the same in https://docs.unity3d.com/Manual/class-OffMeshLink.html and this https://docs.unity3d.com/Manual/nav-CreateOffMeshLink.html

    But what he looks is https://forum.unity.com/threads/how-to-trigger-a-jump-on-an-offmesh-link.313628/
     
    Xwilarg and DwinTeimlon like this.