Forum rules - please read before posting.

NPC Follow/NavMesh issue...

edited June 2014 in Technical Q&A
Anyone had any joy with getting this working? Animations are in correctly etc but for some reason once it's active the NPC seems to "fall off" the Navmesh and wander about causing some pretty off looking scenes of them flying around the player... 

Should mention I'm working in 2D here as well...

Comments

  • OK, So as I appear to have fixed it...partly! The problem now is that if the player and NPC touch the collider knocks the player of the NavMesh ! Is there ANY way of confining both player and NPC to the X-Axis only? 
  • Depending on what 2D mode you're working with, you may be able to check the Is trigger? checkbox in the NPCs collider.  You can't lock an NPCs movement of axis, but doing this may remove the Player / NPC collisions.
  • Nah the "is trigger" seems to make no difference... ideally I'd like him to not have a collider at all which is how I've set it up now so that the NPC just walks to certain points triggered by simple variables rather than following the player... Sadly even with this he still "falls" off the navmesh... the scene I'm creating has a black border and the character walks to the marker just fine, animation plays etc however when he reaches it he drops below the navmesh into the border...
  • When you say "fall", do you mean he literally falls due to gravity (as in, he keeps falling and doesn't stop) or do you mean he's simply placed off-screen correctly?

    Screenshots of the in-game view and view of the scene setup would help me figure this out.
  • Hi Chris, Gravity is disabled so sadly not the cause. 


    Images in the above link should explain it a bit better
  • Thanks.  The Hotspot shouldn't be a child of the NPC / sprite - just attach the Hotspot script to the same GameObject as the NPC script.  That may fix it or not, but it's best to get things set-up properly before we debug further.
  • Added the HotSpot script to NPC.. same issue :( but the hotspot is less...float-y as a result...
  • What happens now, exactly?  Need to see a screenshot of the positions of the various GameObjects in the cat (the base, the sprite child etc).  It's not clear if this is because the NPC itself is in the wrong place, or the animation is wrongly set-up and is literally offsetting the sprite.
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.