Open Evil-Mastermind opened 3 years ago
I wasn't able to reproduce this at first, but I can now confirm this.
The pathfinding obstacle behavior seems to ignore all collision mask modifications and any rotation.
Here's a simple scene set up, the stretched crate is rotated from it's normal position, and is an impassible pathfinding obstacle.
Here's what happens when I click above the box. It goes around an invisible wall (prescisely where the boundary box is), then goes through the sprite.
https://game-previews.gdevelop-app.com/1622301720948-354654/index.html If you'd like to test for yourself.
I am seeing a similar problem with Physics collisions on sprites that are rotated and have increased width. I can create a new issue if these problems are not related.
I am using the default Physics collision settings for the "static" blocks, and the balls are using the "circle" shape with a correct radius (30 pixels).
https://twitter.com/VictrisGames/status/1398865857955074052
https://user-images.githubusercontent.com/8879811/120092774-ca062e80-c0d2-11eb-9f96-1b52cd718fc6.mp4
I've found that when you stretch a Physics2 object you need to invoke "Shape Scale" to update the collision mask.
I've found that when you stretch a Physics2 object you need to invoke "Shape Scale" to update the collision mask.
How is this done? Is this an action for Physics objects? (Answer: YES)
I will try this and write back. Thanks!
This PR allows to choose between 3 collision methods: legacy, hitbox and AABB. The hitbox method is what you are looking for. There is a GDevelop custom build to try it. https://github.com/4ian/GDevelop/pull/2284
The NavMesh extension allows to workaround this issue.
It uses a very old version of Recast tweaked for 2D.
We should probably wrap a more recent version using Emscripten like Babylon.js did:
Describe the bug
If you set up a sprite obstacle and a simple move to click location event on a character, the character refuses to pass through the area of the entire bounding box, not just the collision mask.
(Game where bug occurred linked at bottom)
To Reproduce
Create a character with a move to clicked location pathfinding style of movement.
Create a pathfinding obstacle that does not fill the entire area of the bounding box with the collision mask.
If the main character starts within the bounding box of the obstacle but outside of its collision mask, the character refuses to move.
Having the character outside and clicking to go through the non-collision area of the sprite causes the character to move along the bounding box.
Other details