Hi Chris
I'm not entire sure this is an AC issue. I have a building, which the player can walk in to. I want to have a roof area where the player can walk on top of the building. The entire building object is part of the navmesh with a navmesh modifier component on it. I can see the navmesh both inside the building and on the roof.
However, when the player climbs the stairs to the roof, via a path he follows, he then can't use the navmesh on the roof. When I click on the roof, I don't see a click marker as I would expect, but I also don't get any console messages, not even ones saying that the player can't find a navmesh.
The player character then tries to walk of the edge, and if I encourage him, he lands on the ground, and walks IN TO the building.
It's as though the click/ray is going through the roof to the ground floor.
I've tried putting a plane and/or cube on the roof and putting a navmesh modifier on that, thinking that that might block the ray from going to the ground floor, but the same thing happens.
Any ideas why this might be happening?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
All the objects in my case are on the navmesh layer. The navmesh appears in scene view, as in the screenshot.
I can put a marker on the roof and make the player walk to it but the player walks around and around it, often avoiding it, as though it can't find a path to it.
It looks like there are two NavMeshes on the roof - or am I misreading the screenshot?
Point and click requires the floor to be on the NavMesh layer, this should block clicks behind it.
If the point clicked has no detected NavMesh underneath it, however, AC will search around it in screen-space for one nearby. You can configure this behaviour in the "Movement" panel in the Settings Manager.
To prevent clicks from reaching the ground floor completely, however, you can either reduce the "NavMesh ray length", or place a Trigger on the Default layer down just beneath the roof - this will also block clicks behind it.
Does that occur normally, i.e. on the ground? The Manual's "Precision movement" chapter has some suggestions to help improve this behaviour.
Hi Chris
I've just tried a trigger under the roof, but that doesn't work I'm afraid. Same issue. Clicking on the roof area doesn't show a click marker and the player wanders around as though he's lost.
I've also tried changing the Agent height in case it was causing issues but that didn't work.
There were two navmeshs in that screenshot, you were right, but that was only because I accidentally turned on a previous cube based navmesh from another test when taking the screenshot. With one, two or a dozen, same issue.
You can see a video of the issue here.
https://i.imgur.com/vgSgxby.mp4
And here's one with the scene and game view, and you can see the Paths are created as expected at times, but they appear to be on the Ground floor.
https://imgur.com/5ulBqFW.mp4
You can't see me clicking as the click marker never shows, but I'm clicking like mad and the player wanders around trying, I'm guessing, to reach the ground floor under where I've clicked.
This may be related to the Player, rather than the scene.
Does this occur if you don't have NavMeshAgent / NavMeshAgent Integration components? Try the 3D Sample Player template, using the "Modify existing" option from the New Game Wizard.
In the end the only way I could make this work was to have two surfaces, one on the ground floor, and one on the roof. I then have an actionlist which triggers a variable change, which then forces the ground floor navmesh to turn off, and the roofg one to turn on. Then vica versa as the player moves.
It has some side effects but for now it's all I have.