Stopping with millimetre precision (Pawn)

So, is the problem “find the wall location,” or is the problem “once I know where the wall is, make the pawn stop exactly there?”

If you have to dynamically find the wall location, then you very likely need a small amount of slop in the gap between the blocks for the block to really fit – 1 cm should be plenty.
Then, use eight ray casts to find the walls nearby the pawn, to figure out what support planes to “snap” to.

Jam eight sensor traces into the array something like this:

You can break the hits that you get, and calculate supporting planes to snap to.

You will presumably only pay attention to planes whose normals point in the same direction as your movement direction, and/or whose normal dot your normalized movement is close to 1 or close to -1 (so the planes are perpendicular.)

1 Like