Forum rules - please read before posting.

NPC - Going up ramps

I tried searching to see if anyone has run across this problem with some NPC following the player up ramps. I'm still trying to track down what the root of the problem is (currently, I'm thinking that a 45-degree ramp is too steep?)

Or maybe I can try to teleport the NPC up the ramp, for now?


Comments

  • What is the problem, exactly? That they move too slowly, or not at all?

    In my experience, a Character Controller gives better results than a Rigidbody / Capsule Collider combination, and it also has a built-in "Slope limit" field. Which method does your NPC use?

  • Oh, sorry! I thought the images posted as well.

    In this image
    https://drive.google.com/file/d/1VvHTQ0xi0FCu1EZ3-1-1vzYoUFhoWhFs/view?usp=sharing

    I currently have this ramp where the player is able to traverse up with no issues. However, once I have an NPC follow the player, they seem to ignore the collision, and not go up (see below)

    https://drive.google.com/file/d/1Chdlt7QylpUd9d1feedZ6z3t9ECHMZUF/view?usp=sharing

    Other tests I tried:
    Currently, I'm just teleporting the NPC to go up that path, but they seem to still ignore gravity when it comes to following the player.

    I also tried using the paths system that is part of the Adventure Creator package but they don't seem to be able to follow the path even ignoring gravity and if the gravity was on they cannot seem to follow the collision.

    The NPC isn't on any special Tag or Layer. My collision that I made through ProBuilder is also not no any special Tag, Layer, and the "Static" is checked (and the arrow is set to Everything atm).

  • It looks more like a collision issue rather than anything to do with the size of the slope. Even if the slope is too tall, they shouldn't be just clipping through the stairs.

    I assume you're using the "Unity Navigation" pathfinding option. What does your NavMesh look like?

    If the set geometry has colliders attached, what of the NPC? Let's see screens of the Inspectors of both your NPC and the stairs object.

    Be aware that AC characters can operate without physics/collider components so long as the floor is flat. Is it possible they've been going without one so far, or are there other areas of your scene with height changes that they are able to navigate?

  • edited April 2021

    Yessir, I'm using the default "Unity Navigation"! Here is the baked navmesh that I'm using:

    Stairs Screenshot

    NPC Screenshot:

    Ah, yeah that makes sense. I just now had him teleport to the desired height THEN follow the player, and the NPC appears to be running in the sky.


    Edit:

    Then I unchecked the "IsKinematic" and now he seems to be working with the collision!

    I never checked the most obvious check :facepalm:

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.