Forum rules - please read before posting.

Unity 5 NavMesh Issue

edited May 2015 in Technical Q&A
Hi there,

I recently imported a project I was working on in U4 to U5 and it went surprisingly smoothly (aside from a few sound files which needed re-encoding from 32bit), which is awesome!

One issue I did have was that the Navmesh failed completely. In U5, if you click anywhere other than a hotspot, the player character will skip around, and if you click on a hotspot then the player will move towards it, but will teleport to a seemingly random location part way through, then complete the journey.

I've tried re-baking the NavMesh, deleting it and adding a new one, I've tried adding a static obstacle but the character seems to ignore it. I've searched around for people with similar issues and there seems to be one on the forum but it seemed to resolve itself randomly (I tried the same steps but it didn't work). I've found a couple of other threads online which describe similar issues, but none of them have satisfactory results. I also noticed that the NavMesh settings are somewhat different in U5, it looks as though you can't set the Agent radius and height as low for example. My settings are as follows:
Agent Radius - 0.5
Agent Height - 3
Voxel Size - 0.25
Min Region Area - 0

I've also set my characters' Circle Collider Radius to 0.0001 (which is now situated on the Sprite Child).

Any ideas?

UPDATE - The teleport seems to occur when the user is either standing at or just reaching a hot spot.It will also teleport when clicking elsewhere on the screen if the character is in motion.

Comments

  • edited May 2015
    Check that you haven't got any components on your player that might conflict with it, e.g. NavMeshAgent.  I can't understand why the character would teleport at all unless something else was causing it.

    It's also important to keep the navmesh as close to your segments as possible - such a large height value would likely cause problems, though I haven't had a problem with lowering it myself to a better value.

    Beyond that, I can't give much advice because I can't see what you've done or what your scene looks like.  Though I wonder: did you mean a Capsule Collider?  Because you shouldn't be using a Circle Collider on a player guided by a baked NavMesh.
  • Apologies, I should have mentioned that I'm using the Top Down 2D mode. It appears I've been doing it wrong all along, but strangely up until now it's been working. When I started out I basically followed the tutorials on both YouTube and the site here. There is mention of using 3D RigidBody and Capsule Collider in the 2D overview tutorial, which I should have picked up on, but there isn't a Top Down 2D character creator tutorial, so I just followed the 2D Sprite Based character one by default and hence have been using 2D components on my characters this whole time. I've now switched all my characters over to 3D components and it's working nicely again. I did have one question though, I've set my Capsule Colliders to 0 radius, othewise the characters push each other out of the way all the time, are there any issues with doing this?
  • Only if you see any!  I'd recommend instead raising the mass of your Rigidbodys, but since your game isn't in "true" 3D, it won't matter too much so far as I can tell.
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.