First of all Hi
![;) ;)](https://adventurecreator.org/forum/resources/emoji/wink.png)
I'm new here...and I'm in love with AC
![:) :)](https://adventurecreator.org/forum/resources/emoji/smile.png)
2 simple questions:
a) I have the first floor of an house and my navmesh is simply all the base of the first floor...the problem is I can click the navmesh trough the walls and my character just move in that direction...how can I fix this?
b) If I have stairs how can I say to the character to change animation to go up or down? Can I add a variable like height or something like that? I'm using mecanim atm
thx so much
Comments
Thx
Buying an AC license does not include a 24/7 Service Level Agreement with response time <24h ...
Work on something else while waiting for someone (maybe Chris) to help for your particular problem.
Cheers,
orrence.
a) if your navmesh is Unity based: have you baked it?
b) your navmesh will decide where on the stairs you are able to go.
b) You could use the Character: Animate action to set a bool like "IsClimbingStairs" when on the stairs, but this wouldn't change based on direction. For that, you'd need to write a custom script that affects a Mecanim parameter based on the change in the Player's height while moving.
So I tried to put collissions cube on the walls but the character still finds the way to the other rooms...if I put the collission cubes on the navmesh layer he continue to walk like he's trying to reach a point behind the wall...what can I do?
Edit: the character continues to move only iif he's walking...if he runs to the wall he stops...can't figure why...
Replace:
if (settingsManager && sceneSettings && Physics.Raycast (ray, out hit, settingsManager.navMeshRaycastLength, 1 << LayerMask.NameToLayer (settingsManager.navMeshLayer)))
{
with:
if (settingsManager && sceneSettings && Physics.Raycast (ray, out hit, settingsManager.navMeshRaycastLength))
{
if (hit.collider.gameObject.layer != LayerMask.NameToLayer (settingsManager.navMeshLayer))
{
return false;
}
Then lay down a CollisionCube over the walls, only place it on the Default layer.
However, you may be able to get around this simply by lowering the CollisionCube such that the top of it is only about a foot above the floor. The character won't be able to move past it, but you'll be able to click on the correct part of the floor.