Hi all,
I am just beginning to learn AC and follow the youtube first tutorial for 2d games. Everything is fine, until cut the navmesh hole at 1:09:26
My Problem is the "Treehole" polygon position when I increase the screen or decrease the screen. The hole is somehow has a fixed position on the screen, and it has nothing to do with my game object...
Please see the screenshot:
This is correct:
https://www.codehamster.com/wp-content/uploads/2025/05/2025-05-06_22-28-09.webp
But the position goes wrong, when I increase the screen,why???
https://www.codehamster.com/wp-content/uploads/2025/05/2025-05-06_22-26-56.webp
So my treehole will not stay in the correct position, how can I solve this problem?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @connygy.
Looks like it could be z-position related - does this occur if you set the Z position of both the NavMesh and the hole to 0?
Hi @ChrisIceBox , thanks! Exactly, it is because of the z-position. I set both NavMesh z-axis to 0, then the hole is on the right position.
But here I am a little confused, if camera is set to "orthographic", then the z-position should have no effect... But why here the z-axis has impact on camera?
Good question. It's probably not a camera issue - but one of the NavMesh when it comes to extracting the hole's vertices to add to itself.
I'll look into this and see if it's possible for the NavMesh to ignore the Z position, as it shouldn't be factored in like that. Thanks for raising the issue, and apologies for the early trouble.
Hi @ChrisIceBox , it is no a big issue, because you have said in the video before making the polygon collider, that we should set the "Treehole" position as (0,0,0). I just ignored it... If people follow you, they won't have this problem.