Download

Player can't go through door in Top-Down game

Hey guys, I’m facing a problem.

I wanted to make a project based on the “Top-Down” template. It’s based on the Hamiltonian Path Problem

In the game the player has to somehow reach through doors from one corner to the other (Not explaining the boring large bunch of useless info) across each and every room

once the player reaches a room through a particular door, it gets locked and he can’t use the same door again to exit the room. I change the Door’s Material to show it to the player. The doors open vertically upwards and downwards. I’ve used Timelines for that. Now something’s Troubling me. Even if the door is opened the player can’t go through the door, due to some collision issues. If I change the collision presets other than default then the door is useless. Please help and revert back with a solution.

This is the Door’s Blueprint. Collision Presets - Default.

Show us:

  1. the “Door_Open” and “Door_Close” timeline values.
  2. Collision box for your door mesh AND surrounding wall meshes.

I’m almost sure your are not moving it enough to open it.

Also, are you sure it is triggering at the correct times?

I believe he asked the same question in answer hub. I was able to trace it down to recast nav mesh. You have to set runtime generation to dynamic. Simply speaking the nav mesh which is used to move around in top down template needs to be refreshed once the door has been lifted to create a path for character to walk on. This is only a problem when you are using mouse movement from the template. If you bind keyboard keys to move around just like in other projects you will be able to get rid of the nav mesh all together and just move around using arrows, but it all depends on what is the end goal.

Also if you come across the problem with clicking on the wall/wall top and you character stops, expand you mesh so it goes above the height of the wall. You might need to make it a bit wider so it actually generates nav mesh field. Use “P” to toggle visibility of the nav mesh.

Yes I did post it there, Sorry I wasn’t sure where to post such a Question. Thanks For your reply. Will sure revert in case any more problems occur. Where do you need me to go so as to refresh the Nav Mesh?

All you need to do is have your main editor window open and in World Outliner (right hand side) search for Recast and then set it to dynamic. Screenshot below for clarity.

Yes I suppose the code is correct, because I had to test-run this program by setting up Collision Presets from Default -> Ignore Pawn OR setting up In the custom section. In this way, The player could go through closed doors as well. However, During this time, The game was running exactly how I had it planned. The only thing is That the player shouldn’t be able to go through the door once its closed, ALSO to be able to go through when its opened.
The door’s location is set to change along the Z direction, from 0 -> +310. And its way more than the pawn’s height.

WOAH.
THANK YOU SO MUCH.
Such a compact solution! Thank you very much for the help!
What does Runtime Generation do anyway? I hope you can tell me, I’d be thankful.

You’re welcome.

Basically it does refresh your NavMesh (the green field when you press “P” in editor). Before, when you moved your door the game wouldn’t generate new nav mesh that’s why you couldn’t get through the door. There was no path for your character to follow. No it is generated Dynamicly so it will create a nice path for your character to walk on once the door is opened. I didn’t know about this before, because I don’t use top down template much so we both learned something new.

Hope my explanation makes sense. :slight_smile:

Yes Definitely! Thank you! See you later :wink:

Hey There! I have started to face yet another problem. now I can’t move at certain places of my game. usually the far off places. it is shown in the ss. the player doesn’t move anywhere here. but can move everywhere else at the back. please help.

In the top left corner of the viewport, while running the game, under the “Show” menu, check “Navmesh” so you can see if that area is actually navigable.

You’re Right! The nav mesh is bound to only some part of my map. I expanded my Nav Mesh Bounds volume and now works Perfectly! Thank you lots !

Now I want to show a level complete when the player has gone through all the doors. How do I do that? please help

UMG Widgets can do that