Forum rules - please read before posting.

Raycast causes issues when clicking outside the navmesh

Hi,

I'm creating point&click type of game with Adventure Creator, but there is currently an issue with the drawcalls.

I have custom made navmesh (same method as in demo), and every time when I click outside of the navmesh, there seems to happen something with the drawcalls.

There is attached image that shows one of the spikes when drawcalls are more than 6000. It causes a big impact for the performance.

I don't know that is it causing it because now the player seems to trying to walk even if I click outside of the navmesh? So if I click outside the navmesh the raycast somehow cannot find it and causes the lag?

Is there any ways to fix that when you click outside the navmesh (example the walls) the player don't try to move in that point if there is not any navmesh placed?

Thanks!

image


Comments

  • Almost forget - Unity version is 2017.2.0b11 if that is the case that causes the problems
  • I actually found that when changing the "NavMesh search %" for "0" changes that the player cannot click outside of the navmesh. It seems to fix also the drawcalls bug.

    But if you add something between 0-1 it starts again.
  • Also one notice that when decreasing the navmesh area works fine that the player can't try to continue walking for the raycast location.

    The drawcall problem seems to come even if the "NavMesh search %" is set to "0.1". If you click for the walls that are enough far away from the navmesh and the raycast search area, then it works but when it's enough close to navmesh and it trys to use NavMesh search % then the problem occurs.
  • Welcome to the community, @Exo.

    When the NavMesh search % is non-zero, clicking outside the NavMesh will invoke an algorithm that checks to see if one is nearby.  Setting it to zero disables the function, which is why even a value of 0.1% causes a slowdown.

    What's the resolution of your game?
  • Hello and thanks for the reply!

    There is not yet made any critical changes for the default Unity setup. In game drawcalls currently are about 30.

    So would it be that the looking more towards to the resolution setup could fix that drawcall spike or could it be in code?
  • I have a hunch that it's related to the resolution, which is why I'm asking.  Depending on, it may be that a performance boost can be added.
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.