Forum rules - please read before posting.

Trigger colliders blocking point and click movement in 3d Game

edited November 2023 in Technical Q&A

Unity Version: 2021.3.5f1
Project Type: 3d, HDRP
Adventure Creator Version: v1.76.1

So, this problem only applies to Point and Click movement using the mouse, not direct input via keyboard or controller. It happens with both my custom character and with Tin Pot from the demo.

I've set up a scene with a number of different NavCams and am using the Trigger object created in the AC Game Editor panel to trigger camera changes. That works fine. The issue is that my character does not want to path into any of the trigger object via mouseclick - he'll do it if he brushes into it by accident and velocity takes him a step or two into it. If I drop the player start into the trigger volume and click to move anywhere inside the object, the character paths to the closest location to the click OUTSIDE the object. All of the camera switch triggering works just fine, it's only pathing that's driving me nuts.

It seems to be due to the Box Collider being the detection method, but it also causes all this ruckus. The object has two triggers (on enter and on exit camera switches) and the box collider, nothing else. It's Navigation static, is on the Ignore Raycast layer, and is untagged.

So am I using the Trigger object wrong, or is there a better way to do camera switching based on position within the map? I'd prefer to keep the rigid body on the character, because I do need the character to go up/down things like stairs.

Comments

  • Welcome to the community, @SpecificImpulse.

    You're using a very old version - are you not able to update to the latest release from the Package Manager?

    If a Trigger is affecting Point and Click movement, it's either down to its GameObject being on a layer that the click intercepts, or it affecting the shape of the NavMesh itself.

    If the Trigger object is on the Ignore Raycast layer, then the former shouldn't be the cause. However, if its marked as Navigation Static, then its likely being included in the NavMesh baking and so being carved out of the NavMesh - preventing characters from pathfinding through it.

    If you open the Navigation window and view the baked blue NavMesh in the Scene window, does it carve out the Trigger? If so, unmark it as Static (all types), and re-bake it.

    Otherwise, share some screenshots of how the NavMesh looks, and the Trigger object's Inspector, and I'll try to spot what's wrong.

  • Thank you, Chris!

    I hit update after not opening adventure creator for a few months and package manager assured me that Adventure Creator had been updated, but it looks like what it really told me was that I had downloaded it, but forgot to hit the import button to update the unity project.

    Updating to 1.78.4 solved the problem without changing anything else, though perhaps for your peace of mind I can assure you the NavMesh wasn't including the trigger collider in it, and I could path into it just fine using keyboard or controller input.

    So, as I suspected, it was just a case of me being a dummy and not updating the way I was supposed to!
  • No problem, thanks for the details.

    As it's a fair jump between versions, though, I'd recommend checking the "Upgrade notes" sections for the versions you've skipped - just in case there's anything you need to be aware of that may not be immediately apparent.

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.