Forum rules - please read before posting.

Pathfinding with NavMesh is making every collision not working (?)

Okay yes, that is a strange discussion title.

But i'm having this problem since a lot of time.
I already reported the bug here
https://adventurecreator.org/forum/discussion/9117/weird-problem-player-character-lagging-in-some-part-of-the-map-and-other-related-issues#latest
I thought i had solved it, but not really.

My problem is:
SOMETIMES (i'm struggling to understand when) the main character starts to ignore EVERY kind of collisions - collision cubes, box colliders, ecc..
After a lot of attempt, i assumed that the problem starts from the Pathfind system or the Navmesh.

Let me explain.
I have this OnStart Cutscene.
If i don't run it, the game work correctly.
If I run it, after it's finished, the main character ignore every collisions. That happen every time, so i thought there was something going on in the cutscene.

I tried to remove the only 3 nodes in the action list that has something to do with Pathfinding or Navmesh, run the game with the cutscene, and everything is working fine.
This 3 nodes are:
2 Character - Move to Point with "pathfinding" checked.
1 Character - NPC Follow.

I tried to uncheck the "pathfinding" box, and the game run correctly.
But still the problem came with the NPC Follow.

I would really like to understand what is causing this problem, and solve it.
Any help will be appreciated.

I link some images below:
My Navmesh, the action list nodes mentioned, My player inspector
https://imgur.com/a/MbaNKPN

In the other discussion there are some other informations.
Last time I thought the problem was the lag.
Now the game is not lagging anymore, but still don't work.
I tried to change some parameters in Unity's Physics or Time settings, but nothing changed.

If you need more information, just ask me.

Comments

  • What are your AC and Unity versions?

    The pathfinding shouldn't affect the character's ability to react to colliders, since the latter is still based on Unity's 2D physics system.

    Check the Player's own Collider2D and Rigidbody2D components before and after the issue occurs. Is there any difference?

    I may have to see this for myself. If comparing the components doesn't reveal anything, see if you can PM me a unitypackage file of the scene, player prefab, NPC prefab, and your Manager asset files - with instructions.

  • Thank you Chris, I guess i found the cause of the problem.
    But still i can't find the solution.

    I compared the Main Character's Collider2D before and after the problem, and it turns out, something is checking "is trigger" randomly.
    Of course, when it is checked, the player ignore every colliders.

    Now. How can i understand what is making "is trigger" checked?

    I made other attempts:
    If i run the game and skip the OnStart Cutscene, "is trigger" became checked.
    I tried to run the game, watching the whole cutscene, step by step, without skipping it, and at the end, "is trigger" didn't become checked.

    One may think the problem is on the cutscene, but sometimes during the game, randomly, the same problem occurs.

    So i need to understand what is causing it.

    It can be something related with pathfinding?
    Because every time this problem occurs, pathfinding is the most probable cause.

    Let me know what other informations I can give to you.

    Thanks

  • Thanks for the details.

    I believe this is related to the Character evasion setting in your Navigation Mesh Inspector. Does setting it to None prevent Is Trigger from being set?

  • YES!

    I changed it to "None" and, so far, everything is working fine.

    Can i ask what was the problem?

    Anyway, i will continue writing here if the problem occurs again.

  • Can i ask what was the problem?

    2D Character evasion works by cutting holes in the NavMesh that characters then walk around. This process also makes sure evaded characters have "Is Trigger" set - as their colliders can otherwise interfere/block movement of other characters that walk around them. Such characters should typically have this already set, but the operation does this automatically for convenience.

    I shall consider making an exception, however, when dealing with a Directly-controller Player character, since he requires a non-Trigger collider to move. Unless your NPCs move around the scene, this shouldn't cause any issue to your situtation.

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.