The issue does remind me of 2D platformer player controller edge detection issues, which recommend using a capsule collider to avoid getting stuck on slight changes in "ground" colliders and co. UPLOAD IMAGE Step 2: Arrange Puzzle to Solve Drag and Drop the puzzle pieces to match your current puzzle obstacle. Step 1: Upload Template (Optional) To get started, upload your image template below. I'm open to the idea that what I want to do with dynamic rb2ds may not be possible without making changes similar to what I mentioned in the first paragraph (or working out a grid movement system, perhaps trying kinematic collision), but I'm curious about this. 8 Puzzle Solver AI-powered puzzle solver, let you find the solution of the sliding 8-puzzle in just a second. Movement script (I'm not sure it's all that relevant here) Main question: Is there a way to assure consistent sliding movement with the right amount of spacing, and without resorting to using the edge collider or allowing for "wiggle room", or is that essentially not possible (perhaps without having a deep understanding of physics and physics engine "under the hood", or using kinematic movement instead)? If it is possible, how can I calculate the precise right amount of space? (bc2D size with room for the Default Contact Offset) Gif showing movement with bc2Ds size at (2.98, 1.98) Gif showing movement with bc2Ds size at (2.99,1.99) If I have that at 0.01, does that mean I want my bc2Ds to be shrunk by 0.01 on each side? (like if the bc2D Size is 3,2 in game units, should the size actually be 2.98 and 1.98?) I'm also curious how Default Contact Offset comes into play I have it set to 0.01 which seems sufficient for what I'm doing. Sometimes a piece will move fine, other times (often moving horizontally), they seem to detect a tiny fraction of the bc2D above or below of the grid space they're trying to move into. The problem: being able to slide/drag a puzzle piece is inconsistent, despite being placed perfectly aligned to each other/instantiated right up against one another. (Only one total blocks worth of space is "free".) If the puzzle piece is close enough to a grid piece, it snaps to the grid piece (transform/center), which should give just the right amount of separation for the next piece to move since the grid pieces are the same size as the puzzle pieces. I'm playing around with a sliding puzzle game where the mouse delta can move the puzzle pieces (bc2Ds with slipperiest material possible and no edge radius, dynamic rb2ds w/ no gravity) in the four directions if space is available. (I think I should first mention I believe I found an okay workaround for this issue using an edge radius for the boxCollider2D and making the bc2D slightly smaller to provide enough room for contact generation, but I'm trying to get a deeper understanding of what's going on with the following issue.)
0 Comments
Leave a Reply. |