Forum rules - please read before posting.

Can NPCs not follow player up stairs?

edited August 2023 in Technical Q&A

Hello,

I just wanted some clarification on NPCs following player. I hadn't ran into any problems with it until I got to a part that involved some stairs. When following the player, the NPC will not climb the stairs and go straight through. Is this because of the slope? I have enemies in this project that have no problem climbing these stairs, but all the AC NPCs do. Is there a way I can have them follow the player up a slope like so?

This is a 3D first person project, and I don't have any problems with NPCs following the player when they are on the same floor, just the stairs.

https://imgur.com/a/PjKN3I6

Comments

  • By "going straight through", do you mean they end up underneath the stairs?

    Check the Collider attached to the stairs, though I'd expect it should be OK if the Player can move up as well.

    What are the movement settings for the NPC? Share a screenshot of their full Inspector.

  • Apologies for the lack of clarity: yes they walk underneath the steps as if they aren't there and try to get as close to the player as possible. Everything is fine with following the player until I try to go up the stairs. I confirmed there is no nav mesh underneath the stairs as well.

    https://imgur.com/a/1KPCGbF

    Here is the NPC's inspector, there's quite a bit. The navigation settings is set to: Unity Navigation for the scene.

    I have 'enemies' that don't use AC and they are able to traverse the stairs as intended so I don't think there's a problem with the navmesh.

    Also, I did try unckecking IsKinematic on the NPC's rigibody and it IS able to walk up the stairs, but that's not really something I want to do as it leads to many other unwanted behaviors such as the player being able to push them around, among other things.

  • Try unchecking Move with Rigidbody? in their NPC Inspector.

    Otherwise, if making the Rigidbody non-kinematic works, it may need to be a case of doing so and raising the mass to prevent pushing.

    It's also possible to replace the Rigidbody + Capsule Collider pairing with a single Character Controller, which may give better results.

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.