Forum rules - please read before posting.

Player makes weird movements pathfinding 2d

Hello! I just started learning how to use Adventure Creator yesterday, to use for the development of The Train Hopper. I have setup a 2d scene and 2d character, and everything for the most part is working fine, but occasionally the player makes odd decisions to get to where he needs to go.
This video shows an example of what I mean. Though, it doesn't only happen in that spot.

This is really bugging me, so I figured maybe somebody here could help.

Here is an image of my navmesh.
image

Comments

  • I suspect this is because the player object is ever-so-slightly out of the NavMesh's boundary when he begins walking - notice how he's right on the edge after the first click.

    If a player is not on the NavMesh when pathfinding begins, AC will start the path from the vertex he's nearest to - in this case, it's by the rock.  I shall look into a smarter solution for 1.42 - in the meantime you might get better results by placing one or two vertices along the wider polygon edges, to break them up into shorter edges.
  • Thanks for the help! That does seem to be the problem, as I tried placing some polygon colliders around the border and the player didn't do it anything like that anymore (although I don't think this would work as a permanent solution as the player still plays walking animations when walking into them).
  • I believe I've improved this for 1.42.  I made a test by tracing over your screenshot with a Polygon Collider of my own, and I no longer get the problem.
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.