Forum rules - please read before posting.

Version 1.84 - Unity 6.1- Block walls and other non-interactive objects

Hi,

I have a significant problem with the management of walls or other objects that should be non-interactive in the scene.

To prevent the player from clicking on the walls (the cubes in the scene) or on the middle area (cylinder) which would cause the player to move, I put the layers on Ignore Ray cast but it doesn't block clicks at all.

So I added empty hotspots to avoid any interaction and I added a Nav Mesh Obstacle to the walls and cylinder to better define the navmesh.


I wanted to know what solution to use to do this kind of thing maybe more simply and efficiently because I'm not sure that hotspots are really made for that. Is there an easier way to do this to avoid any interactions, whether it's for the walls or objects on the stage.

Because in addition, the problem with using hotspots in this way is that the hotspot area can block the navmesh's travel area. For example, I purposely put the wall on the right that goes down a little below the ground which means that in game, the hotspot area that we see at the bottom that encompasses the navmesh is not clickable unlike the left wall which is positioned right on the ground. Same problem with the cylinder in the middle which has a hotspot that blocks the interaction of the navmesh upwards.

Thank you for your feedback.

Comments

  • edited September 6

    I'm not sure I completely understood what you are trying to achieve.

    You only add Hotspots onto things that should be interactable. If you leave it as is and not add a Hotspot you can't interact with it. There's no need for setting different layers or adding a Hotspot.

    Also what kind of Interaction Method are you using?

    If you want them to be active later, you can switch it off (add a Remember Hotspot Component and set its State on Start) and you can just switch the Hotspot on with a Trigger/Event or whatever and just set it with the "Hotspot: Enable/Disable" Action.

    The Navmesh things are not Adventure Creator specific but Unity.

    The Navmesh Obstacle carve function is correct to exclude things from it.
    But what does blocking the interaction of the navmesh upwards mean?

    I'm sorry but I'm a bit confused what the Hotspots have to do with the Navigation.

  • edited September 7

    Only attach Hotspots to objects that you intend to be interactive.

    If you're just looking to "block" clicks from hitting the NavMesh behind them, ensure they have a Collider ("Is Trigger" is optional) and that they are placed on the Default layer.

  • That's the problem, if I only have a collider on the walls like the one on the left that I place on the layer default, the clicks still go through which makes the player move.

    I may have explained it wrong. I would just like clicks not to be taken into account on anything that should not be interactive (wall or any other object) because there if I click on the wall the player still moves. Interaction is not blocked

  • Where does the Player actually move to in this example? Behind or in front of the wall?

    The presence of the collider prevents the ability to click the NavMesh behind it, but the Player will still be able to move when clicking walls.

    This is due to the "NavMesh search" options in the Settings Manager's Movement panel. By default, if you don't click directly on the NavMesh, AC will search the area (in screen-space) around the clicked point for the NavMesh. You can disable this behaviour by reducing the NavMesh search % slider to zero.

  • Yes that's exactly what I was looking for, disable the behavior of the NavMesh so that there is no search around. Thank you, it works very well by setting it to 0.

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.