I am making a top down game, and I need blocking terrain, to block both the player and enemies.
the current issues:
Some blocking terrain pieces only block the player for a second, then if I continue moving into it, I phase through it. and get to the other side. It’s specifically on thinner objects.
enemy pathfinding completely ignores the blocking terrain and moves right over it.
here’s the line of code.
Here it would be interesting to know how you actually move the player and maybe how thin the obstacles are. If I move a player object with the top-down movement behavior and have obstacles of different widths, the ‘separate two objects’ - action works without problems.
If you mean you are using the pathfinding-behavior, you also need to attach the ‘obstacle for pathfinding’ - behavior to the blocking terrain. Other collision checks (e.g. ‘separate two objects’ - action) are not needed in this case.
I am using top-down movement behavior. I have checked my collision masks and it seems like I’m actually slipping between the collisions meshes, even though there are 0 pizels between them. But the area where I slip throuhg is the seam between them.
Also I did not know about the pathing behavior needed. Thank you!
That’s weird and shouldn’t happen. A workaround is to use hidden collision objects. You can overlap them and make sure that there is no space between them.