Skip to content

Add physics colliders to buildings and roadside props - #63

Closed
adam133 with Copilot wants to merge 3 commits into
mainfrom
copilot/add-collision-to-buildings
Closed

Add physics colliders to buildings and roadside props#63
adam133 with Copilot wants to merge 3 commits into
mainfrom
copilot/add-collision-to-buildings

Conversation

Copilot AI commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

Buildings and roadside props (lamp posts, trees, signs, fences) were purely visual — the car passed through them with no collision response.

Changes

  • Building collidersBuildBuilding() now adds a MeshCollider to both the Walls and Roof child GameObjects:

    wallGo.AddComponent<MeshCollider>().sharedMesh = result.WallMesh;
    roofGo.AddComponent<MeshCollider>().sharedMesh = result.RoofMesh;
  • Prop collidersBuildRoad() calls RoadsidePropPlacer.Place() and passes each result to the new SpawnPropCollider() helper, which creates a collider-only GameObject at each prop's world position with a shape appropriate to its type:

    PropType Collider Dimensions
    LampPost, SignPost CapsuleCollider r=0.1 m, h=4 m
    Tree CapsuleCollider r=0.3 m, h=4 m
    Fence BoxCollider 2 × 1.5 × 0.1 m
  • Tests — new CollisionPlayModeTests verifies collider presence and dimensions for each building part and prop type, and asserts that props are placed outside the drivable road surface.

Original prompt

Add collision to buildings and other props that aren't on the road, so when the car runs into a building, it is prevented from going through.


⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Copilot AI changed the title [WIP] Add collision detection for buildings and non-road props Add physics colliders to buildings and roadside props Mar 23, 2026
Copilot AI requested a review from adam133 March 23, 2026 00:04
@adam133
adam133 marked this pull request as ready for review March 23, 2026 00:06
@adam133

adam133 commented Mar 23, 2026

Copy link
Copy Markdown
Owner

@copilot review and fix the merge conflicts

Copilot AI commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

@copilot review and fix the merge conflicts

Resolved in commit 0c34246. The conflict was in MapSceneBuilder.BuildRoad() — our prop collider spawning block clashed with the ditch mesh rendering block added by PR #62. The resolved version keeps both: lane markings → kerb → ditch → prop colliders, in that order.

@adam133

adam133 commented Mar 23, 2026

Copy link
Copy Markdown
Owner

@copilot there are still merge conflicts. Rebase these changes onto main and retry the PR

Copilot AI commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

@copilot there are still merge conflicts. Rebase these changes onto main and retry the PR

The local branch is cleanly rebased on top of main (commit e96ecaa sits directly on 87c2eb9), but pushing it requires a force-push, which I'm unable to do from within this environment. The report_progress tool can't force-push diverged histories either.

To finish this, please run the following from your local machine:

git fetch origin
git push origin e96ecaa:copilot/add-collision-to-buildings --force-with-lease

This will update the PR branch to the cleanly rebased state with only our 2 commits on top of main, and no merge commit. All 653 tests pass on that state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants